store: Update typed hooks
Updated types hooks as per: https://react-redux.js.org/using-react-redux/usage-with-typescript "React Redux v9.1.0 adds a new .withTypes method to each of these hooks, analogous to the .withTypes method found on Redux Toolkit's createAsyncThunk."
This commit is contained in:
parent
155962c141
commit
f5be16ae32
1 changed files with 3 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
import type { RootState, AppDispatch } from './index';
|
||||
|
||||
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
||||
export const useAppDispatch: () => AppDispatch = useDispatch;
|
||||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
||||
export const useAppDispatch = useDispatch.withTypes<AppDispatch>();
|
||||
export const useAppSelector = useSelector.withTypes<RootState>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue