Will hooks overthrown redux?

后端 未结 3 659
礼貌的吻别
礼貌的吻别 2021-01-06 13:24

I\'ve been searching for a while about React\'s hooks now, and one question became persistent in my head. Will hooks overthrown redux? This is a fairly old discussion so fir

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 14:06

    Nope, definitely not.

    I addressed this in my Reactathon 2019 talk on "The State of Redux".

    Summarizing: hooks mostly offer ways to do the same kinds of things you could already do, like local component state and avoiding prop-drilling via context. If that's all you were using Redux for, then you probably didn't need Redux in the first place. But, hooks have their limitations, and there's lots of additional use cases for choosing Redux.

    Also, note that we are currently working on designing a public useRedux()-type hooks API for React-Redux.

提交回复
热议问题