您应该像我在下面展示的那样在 index.html 中添加脚本。 此外,您应该避免在此处使用带有 React 检查的 jquery。
+-- React root dir
+-- public
+-- index.html
索引.html
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
--> add scripts here
</body>
此外,您可以导入 Bootstrap 阅读 此内容。