It is complaining about the type. Quick solution would be adding any
as state type.
Proper solution will require following two steps:
- Create RootState type in Root Reducer.
export const rootReducer = combineReducers({
dashboard: dashboardReducer,
user: userReducer
});
export type RootState = ReturnType<typeof rootReducer>
- Provide RootState type to state object.
let userData = useSelector((state: RootState) => {
return state.user.data;
});