Bootstrap突然不适用于我的React JS项目 [英] Bootstrap suddenly not working for my React JS project
本文介绍了Bootstrap突然不适用于我的React JS项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
出于紧急考虑,我的项目已停止工作.我不知道为什么.
Out of the blue bootstrap has stopped working on my project. I have no idea why.
这是我们的package.json:
Here is our package.json:
{
"name": "blankets",
"version": "0.1.0",
"private": true,
"dependencies": {
"amazon-cognito-identity-js": "^1.26.0",
"aws-sdk": "^2.151.0",
"bootstrap": "^4.0.0",
"jwt-decode": "^2.2.0",
"prop-types": "^15.6.0",
"react": "^16.1.1",
"react-bootstrap": "^0.31.5",
"react-dom": "^16.1.1",
"react-router-dom": "^4.2.2",
"react-scripts": "1.0.17",
"react-select": "^1.0.0-rc.10"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
这是我们在index.html中的导入
Here is our import in index.html
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
任何帮助/建议/建议将不胜感激!谢谢!
Any help/advice/suggestions would be much appreciated! Thanks!
推荐答案
此:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
正在加载最新版本的Bootstrap 4.0.0.
is loading the latest version of Bootstrap which is 4.0.0.
并且因为Bootstrap 4与Bootstrap 3完全不兼容,这会破坏您的布局.
And because Bootstrap 4 is totally incompatible with Bootstrap 3 that breaks your layout.
解决方案:
要么为Bootstrap 3加载css(以及相应的js)文件,要么迁移到Bootstrap4.
Either load the css (as well as the corresponding js) files for Bootstrap 3 OR migrate to Bootstrap 4.
引导程序3个链接:
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
这篇关于Bootstrap突然不适用于我的React JS项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文