我想在一个常规函数中使用我的自定义钩子,如下所示,但是React不让我这么做。我想知道是不是我的useUrl自定义钩子无效,或者调用钩子有问题。loading) return data
} 这会给我以下错误: React Hook "useUrl" is called in function "handleAddFormation" thatis neither a React function component nor a custom React Hook function.<
我试图在我的功能组件中使用React useState钩子,但是我得到了这个错误:./src/Person/Person.js
Line 5:43: React Hook "useState" is called in function "person" which is neithera React function component or a custom React Hook function <em
尝试实现一个来自react示例的自定义钩子:,但我得到了以下错误:Invalid hook call.You might have mismatching versions of React and the renderer (such as React DOM)当我尝试将其作为自定义挂钩usePrevious导入时,在useEffect上发生错误我尝试如下:验证r