React Hook “useState” is called in function “app” which is neither a React function component or a custom React Hook function

前端 未结 29 993
花落未央
花落未央 2020-11-30 00:07

I\'m trying to use react hooks for a simple problem

const [personState,setPersonState] = useState({ DefinedObject });

with following depend

29条回答
  •  春和景丽
    2020-11-30 00:47

    I feel like we are doing the same course in Udemy.

    If so, just capitalize the

    const app

    To

    const App

    Do as well as for the

    export default app
    

    To

    export default App
    

    It works well for me.

提交回复
热议问题