当我模拟单击时,参数(使用useState的组件状态)的组件更改。当状态发生变化时,useEffect调用和在useEffect中,我将在修改后使用params分派一些异步操作。为此,我想模拟调度。我怎样才能做到这一点?任何人都可以帮我,谢谢。下面我分享代码。} from 'react';import { useSelector, useDispatch } from 'react-
const tree = component.toJSON(); });现在,当我运行yarn test时,会得到以下错误:
Invariant Violation: Could not find "store" in either the context or props of "Connect(AppWrapperEither wrap the root component in a <Provider> or explicit
我有一个简单的Todo组件,它利用了redux钩子,我正在使用酶进行测试,但是我得到了一个错误,或者是一个带有浅渲染的空对象,如下所示。please ensure the component is wrappedTodos.test.js v2// imported Provider from react-re