我正在尝试使用react- test -library运行一个非常简单的测试,其中一个按钮被赋予一个模拟函数,该按钮被单击,然后该测试检查该函数是否被调用。但是,测试当前失败,因为该函数未被调用。代码如下:import { render, screen } from '@testing-library/react<
我得到了这个错误,我真的不能解决它: src/api/ConnectApi.js
Line 25:8: React Hook useEffect has missing dependencies: 'apiurl', 'dataState', and 'fetch'.functional update 'setDataState(d => ...)' if you only need 'dataState' in the