1import React from "react";
2import { useDispatch, useSelector } from "react-redux";
3import { addCount } from "./store/counter/actions";
4
5export const Count = () => {
6 const count = useSelector(state => state.counter.count);
7 const dispatch = useDispatch();
8
9 return (
10 <main>
11 <div>Count: {count}</div>
12 <button onClick={() => dispatch(addCount())}>Add to count</button>
13 </main>
14 );
15};
16
1const result: any = useSelector(selector: Function, equalityFn?: Function)
2Copied