2
BimaAdi
4y

redux? why use redux? while you can put all global state in localstorage. (hmmm... -_-)

Comments
  • 1
    That's not the point. Or you heard this from co-worker? If so, their research is insufficient.
  • 1
    Don't worry @vintprox . We already move some of global state to redux. But back then when we didn't know about redux, we used localstorage as global state and it was horrible. Last friday we found some state still in the localstorage and my co worker start joking "Why don't we use localstorage as global state like back then hahaha".
  • 0
    @BimaAdi lol haha, I see, he wants pain
  • 1
    While redux may seem complex at first, it really aint that complicated once you get used to it

    It really is about 3 things:
    - global state (store)
    - dispatching actions that change the state
    - subscribing to certain parts of the state

    People do have the tendency to complicate things, but redux itself isnt that hard to grasp

    You may want to look into redux toolkit to reduce the boilerplate a bit

    Please dont store stuff to local storage, it will complicate the life for both you and people who come to work on the project after you 😬
  • 0
    Just use context API
  • 0
    What is the difference between redux and react hooks?
  • 0
    @TopsyKretts I think Redux makes sense for writing stateful applications, but hooks seem quite extensible and TDD-friendly.
Add Comment