UNPKG

cra-template-bod

Version:

The advanced TypeScript template for Bod CLI.

13 lines (10 loc) 647 B
// This file serves as a central hub for re-exporting pre-typed Redux hooks. // These imports are restricted elsewhere to ensure consistent // usage of typed hooks throughout the application. // We disable the ESLint rule here because this is the designated place // for importing and re-exporting the typed versions of hooks. import { useDispatch, useSelector } from 'react-redux' import type { AppDispatch, RootState } from '../store' // Use throughout your app instead of plain `useDispatch` and `useSelector` export const useAppDispatch = useDispatch.withTypes<AppDispatch>() export const useAppSelector = useSelector.withTypes<RootState>()