Issue
React-bootstrap doesn't work in votes. i have tried with vite, but it is react-bootstrap styles are not working. Her i have been attached stackblitz link Code Link: href="https://stackblitz.com/edit/vitejs-vite-9pbtfk?file=src%2FApp.jsx" rel="nofollow noreferrer">https://stackblitz.com/edit/vitejs-vite-9pbtfk?file=src%2FApp.jsx . Refer it You will understand issue
I am expecting React-bootstrap styles should appear properly. But it doesn't happen.
Solution
I wonder if it has anything to do with Vitejs. In my point of view, the reason is that you forgot to import the necessary styles for React-bootstrap.
Here is a quote from React-bootstrap page:
Because React-Bootstrap doesn't depend on a very precise version of Bootstrap, we don't ship with any included CSS. However, some stylesheet is required to use these components.
So in your case, I think you should install bootstrap as a dependency, then import it in your main.tsx
import 'bootstrap/dist/css/bootstrap.min.css';
Here is a modified repo of your example: https://stackblitz.com/edit/vitejs-vite-ut2pbv?file=src/App.jsx
Hope it can help you.
Answered By - khoi nguyen
Answer Checked By - - Jay B. (ReactFix Admin)