您應該像我在下面展示的那樣在 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 閱讀 此內容。