[英]how to run react project created with "create-react-app" in codepen?
I've created very basic react project with create-react-app
command and wish to run in codepen
我已经使用
create-react-app
命令创建了非常基本的反应项目,并希望在codepen
运行
I did below settings under JS我在 JS 下做了以下设置
To run project locally I use command npm run
, how to achieve that in codepen ?要在本地运行项目,我使用命令
npm run
,如何在 codepen 中实现?
create-react-app
compiles all the code into one or many javascript files. create-react-app
将所有代码编译成一个或多个 javascript 文件。 You cannot do that in codepen.你不能在 codepen 中做到这一点。 You can use codepen with pre-compiled react files but you won't get what you would expect from
create-react-app
.您可以将 codepen 与预编译的 React 文件一起使用,但您不会从
create-react-app
获得您期望的内容。
See this Hello World example: https://reactjs.org/redirect-to-codepen/hello-world请参阅此 Hello World 示例: https : //reactjs.org/redirect-to-codepen/hello-world
There are other sites like glitch.me , codesandbox.io where you can clone the repo of create-react-app
and use the node environment.还有其他站点,如glitch.me 、 codesandbox.io ,您可以在其中克隆
create-react-app
的 repo 并使用节点环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.