-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to add React Bootstrap #301
Comments
Here's how I got React Bootstrap working at https://github.com/manavsehgal/react-eshop (Create React App scaffolded app). Step 1. Install React Bootstrap and Bootstrap from NPM.
Step 2. Import Bootstrap CSS and optionally Bootstrap theme CSS in the
Step 3. Import required React Bootstrap components within
Now you are ready to use the imported React Bootstrap components within your component hierarchy defined in the render method. Here is an example App.js redone using React Bootstrap. |
Nice, would you like to contribute this to |
Thx, will do. |
Thanks @manavsehgal! It worked smoothly! |
The provided App.js doesn't show how to work with bootstrap anymore. |
@Oxyrus I think it's on purpose, there is a section of the readme that covers how to add it. |
@gaearon How about yarn instructions? Are they reqd? Or just overkill? |
@ShashankaNataraj I don't think we need Yarn instructions everywhere. I would suggest any Yarn user to also learn the same npm commands. |
Extremely helpful for beginners! Thanks @manavsehgal 👍 |
greate work like a charm... |
Wow..It worked |
Life saver. Thank you! This Medium article has also helped me out with Webpack config in conjunction to react-bootstrap setup. |
Can anyone help me (noob here) understand why the css imports have to be done in index.js ? Why does it not work in App.js? |
The method described by @manavsehgal only works for bootstrap v3 not v4. |
@saranshbansal I'd recommend locking bootstrap on |
Module not found: Can't resolve 'bootstrap/dist/css/bootstrap-theme.css' in 'C:\reactApps\loginpage\src' |
@arpeetgautam that's because Bootstrap version four doesn't have the bootstrap theme css included when downloaded via npm |
The documentation has been updated with Bootstrap v4 |
This comes up fairly often.
Unlike React Router, it is not immediately obvious how to add React Bootstrap because it needs its own CSS. So I think it’s worth documenting this here (even though we won’t document adding e.g. the router) because this is a super common use case for beginners.
The text was updated successfully, but these errors were encountered: