React Tutorial - 23.react-redux
Автор: feeco
Загружено: 2021-10-06
Просмотров: 3
Описание:
1.react-redux is an official lib to manage global state, whereas redux is a third-party lib
a.container vs ui component : containers contain ui components, and they are parent and child component
b.only container component can talk to redux
c.UI components are not allowed to write any redux APIs
d.UI and container component talk to each other by props
2.create container component
a.import connect and use react-redux
b.pass UI component
c.pass store to container component
3.two props
a.mapStateToProps -- pass state to child component(UI)
b.mapStateToProps has already passed state as a parameter when you declare this function
c.mapDispatchToProp --pass callback function to child component to get value from user input
d.mapDisatchToProp has already passed dispatch as a parameter when you decelar
e.import actions
4.optimize our code
a.dispatch
b.remove subscibe and provider
c.container and UI component
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: