在 React 中编辑 App.js 不会在运行 npm -start 时更改 React 的默认页面

问题描述 投票:0回答:1

所以我尝试从我的终端运行一些反应代码(简单的搜索条码)。我将源代码放在 App.jsx 中,默认由“npx create-react-app”制作,但是,每当我运行 npm start 时,我只会看到默认的 React 页面,告诉我“编辑 App.js 并重新加载” 。我在 React 网站的沙箱环境中运行了我的代码,并且运行良好。我不完全确定我在这里做错了什么。有什么建议吗?

javascript reactjs npm package frontend
1个回答
0
投票

npm run start
是启动生产应用程序的脚本。 完成更改后,输入
npm run build
以使用该更改创建构建,然后运行
npm run start

© www.soinside.com 2019 - 2024. All rights reserved.