[英]When passing a component to the app.js file in react, it compiles but the browser keeps loading and doesnt show anything
在 React.Component 中,您只需在构造函数中使用 'state=...' 初始化 state 一次。 所以从你的组件中删除 state={} 。 如果要更改初始 state,请使用 setState()。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.