我试图在我的功能组件中使用ReactuseState钩子,但是我得到了这个错误:./src/Person/Person.js
Line 5:43: ReactHook "useState" is called in function "person" which is neithera React function component
我有一个函数,每次名称状态改变时都会调用该函数。我想把这个更改后的值发送给父组件,但它指出了这个错误:
ReactHook "useEffect" is called in function "handleNameChange" which isneither a React function component or a custom ReactHook function <e