Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
.解决方案:更新react和 react-dom的版本
npm install --save react@16.8.6 react-dom@16.8.6
第二种错误:使用redux时,用redux提供的Provider包裹App组件
错误信息
TypeError: Cannot read property 'getState' of undefined
第一种错误:使用redux时,用redux提供的Provider包裹App组件.错误信息:Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reas...