Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Giuseppe Barbera
Giuseppe Barbera
1,933 Points

Access/edit information stored in Redux Store by deeper components

Hey there, I watched the course Building Applications with React and Redux here on treehouse and i'm still a bit confused on how Redux should be implemented.

Here is my question in detail along with my code

https://stackoverflow.com/questions/46845466/how-to-access-redux-variables-and-functions-from-deep-components

Thanks for any advice

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya there! I saw your question on Stack Overflow and i think i have an answer that might help you a bit. Are you familiar with Flux architecture? I think you should really try out the flux implementation and get the feel. Redux is actually the better implementation of Flux architecture. In other words , its an improvement on the Flux architecture.

Redux is simply a container for all your issues with state. It must contain the state of your application in one place called store. State gets updated by the trigger of actions which are pretty much events triggered the user. And then Actions get dispatched to the store and the store has reducers which helps the store to update the state in case an event is triggered. The most important thing to remember about Redux is you dont mutate the original data , you just update the state.

When everything is in place, you need to plug your Redux container to your React components, by wrapping the whole app in provider component. And connecting the props of the app with the state of the redux so that everytime when an event is fired , the state is updated by Redux libaray and passed as props to the the react components. Btw you can also perform asynchronous data fetching in Redux with thunk midddleware and isomorphic-fetch. So yeah that the bigger picture of React with Redux. In order to dive deep into Redux , first you need to understand how Flux works.

~ Ari

Giuseppe Barbera
Giuseppe Barbera
1,933 Points

Thanks Ari for your answer, I will check Flux as soon as i can. Anyway the question has been answered in Stack Overflow, so if anybody has my same problem just check the link I provided in the main post.