使用react中的钩子测试组件的正确方法是什么?Todos.js const { todos } = useSelector(state => state);
<ul>Invariant Violation: could not find react-redux context value; ...
// i
从我的测试中,我首先在it范围内使用intialState,然后在模拟(‘单击’)增加按钮后,我得到了预期的结果2。当我试图测试it作用域中的减少按钮时,它将获得it作用域的结果。这是我的测试文件import { mount } from "enzyme"; // mount is fulldom renderning functionfrom 'react';
impo
我试图通过React的钩子使用Context和Reducers,并且遇到问题,钩子的顺序不是固定的。Warning: React has detected a change in the order of Hooks
called by Container.下面是Day的摘录,还有react-dnd's useDrop的参考。