React-redux useDispatch() Uncaught TypeError
问题 I'm trying to create a simple component to dispatch an action using the React Redux hook useDispatch - and I'm getting an error. I've trimmed the component down to where the error occurs. It happens when the useDispatch function is called. import { useDispatch } from 'react-redux' const MyComp = () => { useDispatch() return null } export default MyComp This is the error I'm seeing in dev console: Uncaught TypeError: Object(...) is not a function at MyComp (MyComp.js?cc4c:4) at renderWithHooks