React hooks useState setValue still rerender one more time when value is equal

This thread may help you : React: Re-Rendering on Setting State – Hooks vs. this.setState

Also, you can check the second paragraph over here which says:

Note that React may still need to render that specific component again before bailing out. That shouldn’t be a concern because React won’t unnecessarily go “deeper” into the tree. If you’re doing expensive calculations while rendering, you can optimize them with useMemo.

Leave a Comment