React Hook "useA" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function
报错信息
我自己写的代码:
此函数想要放到Button中的onClick中,而onClick里需要的是一个回调?
再看官网,人家写了
https://zh-hans.reactjs.org/docs/hooks-custom.html
*另一种情况
最外层的function名用了小写,那个必须大写。
请不要做笨蛋!!!!