ReactHook "useHistory“在函数"header”中调用,该函数既不是React函数组件,也不是自定义ReactHook函数 下面是我的代码 import { Link, useHistory} from 'react-router-dom' let history = useHistory() <header
有一个,我不太明白它在说什么:
不要从常规的JavaScript函数调用钩子。相反,你可以:通过遵循此规则,您可以确保组件中的所有有状态逻辑在其源代码中都是清晰可见的。
仅仅从调用Hooks意味着什么?一个function函数与我所称的普通函数组件有什么不同?Hook "useState" is called in func
Compiled with problems:X
Line 5:21: ReactHook "useRef" is calledin function "signin" that is neither a React function component nor a custom ReactHook function.React component names must