How it works
Logo@2xLogo mindzip color
Login

Aurélie Bayre

ft
01Follow
FollowingFollowers

Quotes
28

why JSX?
7
React & Redux
can you have more than one root dom nodes?
6
React & Redux
How do you render an element into the dom?
4
React & Redux
Are React elements mutable?
4
React & Redux
There are two ways of defining a component: as a function and as a ...
4
React & Redux
What is the advantage of a class component over a functional component?
4
React & Redux
How do you add local state to a class?
3
React & Redux
why are lifecycle hooks important?
3
React & Redux
Does redux work only with react?
3
React & Redux
Core concepts: actions reducers
3
React & Redux
what's an action for redux?
3
React & Redux
What's the purpose of a reducer?
3
React & Redux
what are the 2 params passed to a reducer?
3
React & Redux
what are the advantages of a single store?
3
React & Redux
How is Redux different from Flux?
3
React & Redux
advantage of immutability in Redux?
3
React & Redux
Redux architecture revolves around a strict unidirectional data flow.
2
React & Redux
Data lifecycle: 1. You call store.dispatch(action) 2. Redux store calls the reducer function 3. combine output of multiple reducer into on single state tree 4. Redux store returns the complete state tree (returned by the root reducer)
2
React & Redux
Ex with a combineReducers() function todos(state = [], action) { // Somehow calculate it... return nextState } ​ function visibleTodoFilter(state = 'SHOW_ALL', action) { // Somehow calculate it... return nextState } ​ let todoApp = combineReducers({ todos, visibleTodoFilter })
2
React & Redux
React bindings for Redux embrace the idea of separating presentational and container components.
2
React & Redux
Container Components: How things work (data fetching, state updates) Dispatch Redux actions Are usually generated by React Redux
1
React & Redux
Presentational Components How things look (markup, styles) Invoke callbacks from props to change data Are written by hand
1
React & Redux
You could write a container component by hand, but we suggest instead generating container components with the React Redux library's connect() function, which provides many useful optimizations to prevent unnecessary re-renders.
1
React & Redux
To use connect(), you need to define a special function called mapStateToProps that tells how to transform the current Redux store state into the props you want to pass to a presentational component you are wrapping.
1
React & Redux
In addition to reading the state, container components can dispatch actions. In a similar fashion, you can define a function called mapDispatchToProps() that receives the dispatch() method and returns callback props that you want to inject into the presentational component.
1
React & Redux
Connecting react and redux: import { connect } from 'react-redux' ​ const VisibleTodoList = connect( mapStateToProps, mapDispatchToProps )(TodoList) ​ export default VisibleTodoList
2
React & Redux
Redux component <Provider> : is used to magically make the store available to all container components in the application without passing it explicitly. You only need to use it once when you render the root component:
1
React & Redux
How do you use <provider> ?
1
React & Redux

We use cookies to understand our websites traffic and offer our website visitors personalized experience. To find out more, click ‘More Information’. In addition, please, read our Privacy policy.