feat: add custom hooks for typed useDispatch and useSelector

This commit is contained in:
siujamo
2026-05-07 10:46:06 +08:00
parent 1a16199f2f
commit af58edbafd
8 changed files with 52 additions and 8 deletions
+6
View File
@@ -0,0 +1,6 @@
import { useDispatch, useSelector } from "react-redux"
import type { AppDispatch, RootState } from "./index"
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()
export const useAppSelector = useSelector.withTypes<RootState>()