小编Muh*_*sal的帖子

未捕获的类型错误:dispatcher.useSyncExternalStore 不是函数

我正在尝试使用 useSelector 和 useDispatch 来更改 bulma 模型的状态
\n像这样

\n
      const isState = useSelector((state) => state.isActiveState)\n
Run Code Online (Sandbox Code Playgroud)\n

Model.js 是:

\n
import React from \'react\'\nimport "../CSS/Careers.css"\nimport { useSelector, useDispatch } from \'react-redux\';\nimport { stateCheck } from \'../Redux/ActiveState\'\n\nexport default function Modal() {\n\n      const isState = useSelector((state) => state.isActiveState)\n  \n      \n\n      const dispatch  = useDispatch()\n\n    \n  return (\n    <div>\n      <div\n        style={{ padding: "0rem 0.5rem 0rem" }}\n        className={`modal ${isState}`}    //this should change the state to \'is-active\'\n      >\n        <div onClick={() => dispatch(stateCheck())} className="modal-background"></div>\n        <div style={{ borderRadius: …
Run Code Online (Sandbox Code Playgroud)

reactjs redux react-redux

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

react-redux ×1

reactjs ×1

redux ×1