I am transitioning a react with redux project from class components to hooks.
To dispatch actions I am importing { useDispatch } from react-redux.
Then, in each functional component, I have
const dispatch = useDispatch();
And then
dispatch(someAction())
Is this the correct way to proceed or should the const dispatch = useDispatch() be abstracted to a separate file and reused all throughout?
Thank you