当尝试使用表单 React 组件执行简单的 Jest 测试时,我收到此错误:
\n \xe2\x97\x8f <LoginForm /> \xe2\x80\xba clicking the validate button \xe2\x80\xba should display page title \n \n could not find react-redux context value; please ensure the component is wrapped in a <Provider> \n \n 14 | const [inputPassword, setInputPassword] = useState(""); \n 15 | \n > 16 | const dispatch = useDispatch(); \nRun Code Online (Sandbox Code Playgroud)\n这是组件本身:
\nimport React, { useState, useEffect } from "react";\nimport { useDispatch } from "react-redux";\nimport { useHistory } from "react-router-dom";\nimport jwt_decode from …Run Code Online (Sandbox Code Playgroud)