Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Voxera113884yRedux is just one state manager.
Hooks is partly state management.
Context isa built in building block for state handling.
Unless you have decided to use redux there is nothing forcing you to use it and there are many newer, and in my opinion easier to use, state management solutions.
Hooks + context goes a long way unless you plan to use a lot of centralized business rules in state.
Mobx is one I liked a lot but currently hooks is sufficient:) -
Just don’t use redux... I found that even for times where you want to have special business logic in your state, you can get away with doing it in hooks (like writing your own custom hooks for auth or API).
-
bioDan56224yNot much of a front end developer here but doesnt redux also stores the state in the localStorage and manages it?
Would you manage your localStorage state in each hook of every component you write? -
Don't use redux. Two companies in a row spent 3-4 months removing it with every little thing going wrong at every turn.
-
bklw234yJust don't use it. Redux sucks, it's a lot of boilerplate to do simple tasks. Hooks and Context do pretty much the same thing in a much better way
-
Well, if you're religious then the god object might appeal to you. Although manually creating a god isn't part of most religions that I'm aware of.
-
Redux is too much work. You need middleware, action creators, and creators of action creators
-
Voxera113884y@Devnergy well, unfortunately that is one pressning reason :/
The reason many avoid it is thats its a lot of boiler plate and its also rather disconnected so its not always easy to follow what is happening.
With good documentation it can work.
But the company I work for started using it a couple of years ago and are now moving away from it because its not worth the extra work needed.
But done right it still gets the work done.
But if its company policy the only way would be to convince some one with the power to change policy and that usually involved proving that a change would save or make more money.
And since a change always has some transition cost its not a given that it is the right business decision. -
@bioDan so no. By default redux will not sync with any cookies/localstorage etc.
You should setup hooks for this (in fact lots of existing libraries that would do this for you, but it’s dead simple to do yourself) -
@Voxera I agree. We will start a project from scratch and the tech lead chose Redux for the global state management. I'm not sure if he likes it, don't know the cons, don't know RxJs/Hooks + Context API or Redux is the only global state management he know. I don't want to contradict his tech stack since he's the tech lead.
RxJs or Hooks + Context API is much better than Redux. -
Voxera113884y@Devnergy what you know is almost alway better than something you don’t know. And if you have lots of existing code or structures you plan to reuse it can also be a factor.
But I would recommend that unless you already know hooks and context that you experiment with it on your own time to learn.
That way you improve your knowledge and once you know it good, its easier to take it up with the tech lead, possibly just the two of you to avoid prestige to be to much of a factor.
Unless you plan to try to replace him, let it be him who takes the idea to the rest of the team, that way he can keep the lead role ;)
Related Rants
-
kiki17You know who sucks at developing APIs? Facebook. I mean, how are so high paid guys with so great ideas man...
-
wxcazee17Here is a tutorial on how to create a contact form in React / Redux.
-
drGreat58So I put a very strict eslint configuration to a 6 month old project .. .. .. .. 924 errors in 27 files .. .. ...
Why should I use Redux in React aside from its beautiful chrome extension? For job purposes only?
I think RxJs and React context API + hooks can do the same job with less codes.
Also, there are a lot of developers who don't like Redux.
Convince me to use Redux
question
yuck
redux