Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

[00] VuePattern 實作筆記-目次

[00] VuePattern 實作筆記-目次

Day 66 - Cafe API Project & RESTful route

Day 66 - Cafe API Project & RESTful route

Sequlize & Express. P1

Sequlize & Express. P1






留言討論