Why Redux is strongly recommending to use hooks API? #1796
Replies: 2 comments 11 replies
-
Multiple reasons:
I disagree that there is a tradeoff in performance. The only difference perf-wise is that the hooks API cannot stop the current component from rendering when the parent component renders and passes down the same props, because hooks run inside of a component while Similarly, I also disagree that At this point, both implementations are highly stable and mature. |
Beta Was this translation helpful? Give feedback.
-
I don't see any reason to use While the concept of hooks is invented, the concept of a higher order function is discovered. And this is why
While But the React team decided that this is the way to go, so let's go after them. I mean, it's ok to have |
Beta Was this translation helpful? Give feedback.
-
In the latest docs of React-redux, they are strongly recommending to use React-redux hooks API, while the connect() method is already much stable and mature than this.
the doc link is https://redux.js.org/style-guide/style-guide#use-the-react-redux-hooks-api.
I understand that hooks have less indirection, less code to write, and are simpler to use with TypeScript than connect is, but it comes with tradeoff than connect does in performance.
I just want to understand if hooks API still has tradeoffs in performance than why at first place it is strongly recommended.
Beta Was this translation helpful? Give feedback.
All reactions