17. React Redux with Dan Abramov

VelvetRose · 131K views · 2016 · 57:11

Open on YouTube

Web developmentSoftware architecture & designtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when explaining how Redux and react-redux work internally, such as why mapStateToProps and mapDispatchToProps are separate and how the store reaches components through context.

Recommended by 3 people across 2 different months, 2017 to 2018.

What it is

A roughly hour-long recorded session in which Dan Abramov, the author of Redux, walks through how React Redux works, including the source code and how components connect to the store. It is a long-form talk-style video uploaded by the VelvetRose channel in 2016.

What people said

Recommends Dakota · 2017-11 · Stack Overflow · on “Proper Redux usage general questions”

I know you don't want to use ReactRedux, but luckily enough there is a video of Dan Abramov explaining the source code. You should watch it, it will explain why they did what they did and how they did it. When I was first learning how redux and react worked together it made every so much more clear (and then I used ReactRedux anyway :)). [this video] There has been a lot of debate on where to connect React App's to the redux store. But it's mostly recommended that you want to connect where it makes logical sense. For example, if you have a container component that holds a bunch of comments, you don't need to connect all of the comments, you can just connect the container. In the same light you do

Recommends Andrey Prokhorov · 2017-11 · Stack Overflow · on “Why mapStateToProps and mapDispatchToProps are not just one function in Redux?”

The author of Redux Dan Abramov explains here [this video] that `mapDispatchToProps` allocates functions for every action creator that is a very costly operation to redo when you have a lot of components. It looks like there are two different mechanisms that detect when redux needs to update the state and action creator bindings - therefore two different functions: `mapStateToProps` and `mapDispatchToProps`. Is this the answer?

Recommends Rajnikant · 2018-08 · Stack Overflow · on “Hook up API results with Redux in react js”

There are few steps Manually you can do using below methods of store object from redux' below method will dispatch action to reducer store.dispatch({type: 'GET_RESULTS' , payload: {}}) store.subscribe will receive all actions, you can register callbacks here. store.getState() using this method you can access current state you can find full documentation and examples at [LINK] example with redux is here redux with react [LINK] for react application you may use react-redux package to integrate redux which comes with Provider component with store property with this you can import your global store object in your index.js file where you are creating App component. With provider component set now

Cites SimplGy · 2017-02 · Stack Overflow · on “Can I inspect `context.store` in any react component?”

I'd like to access context for the purpose of debugging and learning while working on an app that uses React and react-redux. You can see Redux's use of the context object at this point in time in this video: [this video] I have tried: class MyComponent extends Component { constructor(props, context){ super(props, context); console.log("MyComponent context", context); // Just an empty object } static childContextTypes = { store: React.PropTypes.object }; } How can I inspect this context object?