Skip to main content

useAppSelector

const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

React hook to select data from Redux store with type safety. Automatically typed to the app's RootState.

Example

function UserProfile() {
const user = useAppSelector(state => state.user.profile);
const isLoading = useAppSelector(state => state.user.loading);

return <div>{user?.name}</div>;
}