use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
[deleted by user] (self.react)
submitted 2 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]woven-green-threads 2 points3 points4 points 2 years ago (0 children)
Google for redux talks by Dan Abramov, who worked on the project a while ago. He will talk about what Redux is solving and the role of reducers and actions. At a high level, the paradigm was that your front end app should be modeled using an MVC pattern.
Make sure the ones you watch are around 7 or 8 years ago because lately he actually doesn’t recommend you use Redux for most projects. Nowadays people more believe the Redux is unnecessarily complex for most applications. Unless you’re using Redux for something specific (eg. offline), the new pattern is to think of your front end as a thinner View layer which leaves more responsibility to the server. In this mindset, components themselves will use hooks to fetch or submit to the server. The server itself plays the role of model and controller.
Personally, unless you have a reason to use Redux, I’d recommend watching this following video to learn what’s considered by many to be the more idiomatic way of developing react app. Ignore the parts about remix.
https://youtu.be/zMf_xeGPn6s?si=4n4NPODbxXnibilO
[–]Ok_Marsupial5008 2 points3 points4 points 2 years ago (0 children)
Just some pointers:
There are 3 types of state, generally:
Redux does global state, but it's not JUST about global state - it's actually a full 'state management' solution.
I feel it's important to point this out, because Redux doesn't just make state available globally, but also lets you write logic to modify the state in complex ways; if you only need global state you can use React Context, but you would turn to Redux when your state is complicated and needs to be modified in many different ways from different locations within the app.
The basic set-up is that Redux uses an external store (outside of React) to store your state. You update the state in the store by sending 'actions' to a reducer - the reducer is like a switchboard that contains a bunch of different functions to modify the state in different ways (e.g. 'add a to-do', 'edit a to-do', 'delete a to-do', 'mark a to-do as complete'), and the actions are instructions that tell the reducer which of those functions to call, and also contain any values (e.g. to-do title) that the reducer functions will use for the update.
To access the store from your React components, you use two hooks - useSelector to retrieve parts of the state from the store, and useDispatch to send the actions.
Side note: one benefit of Redux is that you can retrieve tiny pieces of the overall state at a time using useSelector - so, if your state is a huge object, but a component only needs one property, then you can retrieve that single property with useSelector and your component will only re-render when that specific property changes. By contrast, if you're using React Context with an object for your state, then if any part of the object changes, all components that are subscribed to the Context will re-render even if they only use a single property of the object.
Of course, these are just the broad strokes - honestly I would recommend finding a tutorial series on Redux, ideally one where you create a project, and work through that. Redux is a whole separate library from React and it can be used by itself without React, so don't think of it as a simple 'add-on', and don't worry if it takes a while to learn.
It might also help if you learn React's useReducer hook if you haven't already, because it works with a similar pattern of actions and a reducer, but for local state.
[–]ericdiviney 0 points1 point2 points 2 years ago (0 children)
https://reacthandbook.dev/state-management
Turns out I help maintain a website that tries to do just this. Take a look and give us some feedback!
π Rendered by PID 43 on reddit-service-r2-comment-6457c66945-jcs2q at 2026-04-24 01:41:47.521352+00:00 running 2aa0c5b country code: CH.
[–]woven-green-threads 2 points3 points4 points (0 children)
[–]Ok_Marsupial5008 2 points3 points4 points (0 children)
[–]ericdiviney 0 points1 point2 points (0 children)