-
-
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
How to include bootstrap? #201
Comments
Turns out, I have to add
|
Let's keep it open for now. I want to make sure this works well both for development and production, and that we document it. |
Well, if react-router is being used, then above method will work only for the home route. Finally, I settled with the following in index.html:
For me, this works for all the routes. |
Yes, this will be a part of #28. I will look at it this week. |
For the CSS it should probably be import 'bootstrap/dist/css/bootstrap.css' BTW. Bootstrap ships built CSS in their npm package. |
How can I get this to work? When I npm install bootstrap and use that import statement, it says the loader can't parse the file correctly.
|
It's probably failing on the fonts that need to be loaded properly. Does the create-react-app's webpack config include the appropriately font loaders? |
The weird thing is if I move bootstrap.css directly into my src folder and import it relatively it works fine... any ideas? |
Sounds like |
Oh, it was fixed in #178. |
The fix will be out in 0.2.0 but you can try using alpha for now: #190 |
@taion answer helped me, but maybe anyone are interested in a bit more detailed instruction so here it goes... ;) I'm using React 15.5.4...
index.js
App.js
|
Import Bootstrap CSS by adding Because I got a problem with BootStrap JS in React-Component |
Still wandering why in create react app there is no scss support. People are using this for ages and this could solve this issue |
@FDiskas Currently there is support for pre-processors (from SASS to CSS) but unfortunately, you can can't include the |
HAS SASS support come as yet? |
@Franzresonates Hi, I'm currently using bootstrap-sass and sass now. And I use |
@jacoahmad which creat-react-app version you are using? |
I followed @isaklafleur's advice but node complained about importing a file that was outside of
|
How will you proceed in production? |
I want to include the bootstrap from the CDN to divert the bandwidth from my own server instead of including it using a node_module. Does the question make sense? |
@cool88 edit your I'll lock this issue because it's hard to track things in old issues. Please file a new issue if you need help. |
I am building an app using create-react-app and bootstrap. But I am not able to import bootstrap in my app. I tried including it in index.html like this:
but it does not work.
So, how can I import bootstrap in my app? Thanks
The text was updated successfully, but these errors were encountered: