ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

#25.2 Redux in React/React Native | Combine reducers

redux in react native

programming react native

Автор: Phạm Quang Vĩ

Загружено: 2020-02-19

Просмотров: 156

Описание: Redux in React/React Native | Part 1: Basic knowledge: store, action, reducer
Part 1:    • #25.1 Redux in React/React Native | Basic ...  
Part 3:    • #25.3 Redux in React/React Native | Redux ...  
Programming React Native
Github: https://github.com/uit2712/ReactNativ...
Music:
Chords of Harmony: Aakash Gandhi
Percolate: Loopop
Sun Machine One: Loopop
Til Death Parts Us: Aakash Gandhi

---------------------------------REDUX IN REACT/REACT NATIVE---------------------------------
Step 0: Benefits of using Redux:
Avoid pass data multiple levels (React/ React native passes props from parent component to its child components
Maybe some child components don't need the passing data, but it contains a component that needs this data), data is useless in some components
Redux makes it's easy to test (actions tell us what is happening), traditional state in every components makes us crazy when something wrong but we don't know where it happened

THREE OBJECTS IN REDUX: STORE, REDUCER AND ACTION

Step 1: Install modules: redux, react-redux
npm i --save redux react-redux
Step 2: Create a simple store, store is used to contain your app states (combines all components state)
Step 3: Create a simple reducer, reducer is a pure function which returns new state based on an action (I will explain this in later steps). Reducer has 2 parameters:
state: this is state of current reducer
action: simple is a plain object contains some value, such as: type (often a string tell something about this action), payload (contains data),...
... Because reducer is a pure function, we shouldn't change these parameters, this is a rule :)))
... NOTE: reducer 'contains' state (we init this with 'initialState')
Step 4: Connect REDUX to our app
Step 5: Build REDUX FRAMEWORK, create folders: store, reducers, actions
Step 6: Combine reducers
Step 7: Use middleware redux-thunk, used for actions which don't return a plain object, such as fetch data from API
npm i --save redux-thunk

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
#25.2 Redux in React/React Native | Combine reducers

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]