Hooks APIͰͷσʔλόΠϯσΟϯά
export const App: FunctionComponent = () => {
const count = useSelector((state: RootState) => state.counter.count);
const dispatch = useDispatch();
const incrementCounter = useCallback(
() => dispatch({ type: counterTypes.INCREMENT_COUNTER }),
[dispatch]
);
return (
{count}
increment
);
};
͜ͷ͋ͨΓͷηϨΫλʔ͕
mapStateToProps, mapDispatchToPropsͷׂΛՌͨ͢