Redux, useSelector, useDispatch


用 hooks 取代 connect

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

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







你可能感興趣的文章

演習課 WEEK14 (QA)

演習課 WEEK14 (QA)

RESTful API

RESTful API

[02] Functional Component

[02] Functional Component






Comments