Skip to main content

Hooks

Content

Some hooks which are present in react-redux have been modified to utilize local store configuration.

These are the changes that were made:

  • useDispatch becomes useAppDispatch:
export const useAppDispatch = () => useDispatch<AppDispatch>();
  • useSelector becomes useAppSelector:
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
  • createAsyncThunk becomes createAppAsyncThunk:
export const createAppAsyncThunk = createAsyncThunk.withTypes<{
state: RootState;
dispatch: AppDispatch;
}>();