[英]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.