我有按钮点击系统和它的工作。API。我不应该在函数中使用useState和useEffect,但是如何通过单击btn触发API呢?
." which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks
我试图理解如何在子组件中使用React而不触发错误。假设我有一个超级简单的组件(这里所有的代码都是可运行的- ):
const TestComponent = (For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of