Closed lichspace closed 5 years ago
https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react
You likely have two copies of React, the one you are including manually and the one packaged by webpack. You can remove the script tags.
include react with
include redux-react-hook with webpack
import {StoreContext,useMappedState,useDispatch} from 'redux-react-hook';
i find _nodemodules/redux-react-hook/dist/index.js has code
var react = require('react');
i think this cause the errorI resolve this with:copy redux-react-hook/dist/index.js to my project and modify
var react = React;//from window.React
so, i want ask has a better way?