Compiled with problems:X
Line 5:21: ReactHook "useRef" is calledin function "signin" that is neither a React function component nor a customReactHook function.React component na
ReactHook "useHistory“在函数"header”中调用,该函数既不是React函数组件,也不是自定义ReactHook函数 下面是我的代码 import { Link, useHistory} from 'react-router-dom' let history = useHistory(
我有一个函数,每次名称状态改变时都会调用该函数。我想把这个更改后的值发送给父组件,但它指出了这个错误:
ReactHook "useEffect" is called in function "handleNameChange" which isneither a React function component or a customReactHook function <e
为此,我必须在useCallack的回调函数中调用Array.mapexport const useSafeDispatches = (...dispatches) => { );当我试图构建ReactHook "useCallback" cannot be called insideReact Hooks must be called in a
我不应该在函数中使用useState和useEffect,但是如何通过单击btn触发API呢? Line 168:31: ReactHook "useState" is called in function "clickCreate" which is neither a React function component or a custom
我正在尝试将一个GraphQL-mutation连接到我的React-app中的一个按钮上。到目前为止,我尝试这样做: const Component = () => { ... )
} 但是,编译失败,并显示以下错误: ReactHook "useTestProgramMutation" cannot be calledReact Hooks must be called in a <em
当按下按钮时,我试图使用useFetch从包中发出请求。这是我的密码import useFetch from 'react-fetch-hook';
import { ButtonHook "useFetch" is called in function "handleOnClick" that is neither a <e
我正在尝试将一个react项目从javascript转换为TypeScript。项目是使用CRA --typescript创建的。我在其中使用了redux-saga。>( memo,
export { HomePage }; 错误消息为: Line 23:5: ReactHook "useInjectReducercomponent or a customReactHook f
我想知道在使用工厂生成回调时,如何最好地返回回传回调函数。目标是在调用带有相同参数的工厂时返回相同的函数实例。,所以我的想法是从工厂返回一个useCallback函数。ReactHook "React.useCallback" is called in function "makeCallback" which is neither a React functioncomponent or a
我想在一个常规函数中使用我的自定义钩子,如下所示,但是React不让我这么做。我想知道是不是我的useUrl自定义钩子无效,或者调用钩子有问题。loading) return data
} 这会给我以下错误: ReactHook "useUrl" is called in function "handleAddFormation" thatis neither a React function component nor a custom
我学习了React和JavaScript,对此我真的很陌生,现在是React路由器V6。我有一个从两个位置调用的方法,并希望创建一个util函数来处理这个问题。它看起来是这样的:import * as ROLES from '../../..Hook "useNavigate" is called in