我是 react.js 的新手。我一直在遵循 how-to-do-simple-form-validation-in-reactjs 中的说明,我可以运行 http://localhost:3000/
但是在 index.js
添加引导程序后,我得到了这个错误
> Failed to compile ./src/index.js Module not found: Can't resolve > 'bootstrap/dist/css/bootstrap-theme.css' in > 'C:\react-form-validation-demo\src' > > ```
import React from ‘react’; import ReactDOM from ‘react-dom’; import ‘./index.css’; import ‘bootstrap/dist/css/bootstrap.css’; import ‘bootstrap/dist/css/bootstrap-theme.css’; import App from ‘./App’; import registerServiceWorker from ‘./registerServiceWorker’;
ReactDOM.render(
如果我删除下面的这两行,它会起作用:
import ‘bootstrap/dist/css/bootstrap.css’; import ‘bootstrap/dist/css/bootstrap-theme.css’;
”`
原文由 Steve 发布,翻译遵循 CC BY-SA 4.0 许可协议
根据 GitHub 上的问题, 在 Bootstrap 版本 4 中,文件“bootstrap-theme.css”已被删除。有关详细信息,请参阅 更改历史记录。
如果您想继续使用版本 4,请删除此导入,否则降级到版本 3。