Redux Flashcards
How does React & Redux work together
One Redux store manages state. React Components subscribe to it. They issue state changes which go up into Redux. Redux keeps the record of the latest state for components.
What to use to make Redux work with React?
react-redux package
What does react-redux do? It allows to…
pass Redux state and dispatch to React components as props
You cannot use this in in a constructor until…
after you call super(props)
passing props to super is necessary|unnecessary
unnecessary, but advised for less confusion and bugs
creating Redux store
you’re just declaring a few functions as const, specifically reducer function - and then you const the store with Redux.createStore and pass it the reducer function