I haven't had the issue of having a limit with React Hooks. I do, however; have seen too many re-render issues. If you have an example, that would help narrow down the question.
As far as I understand, hooks will be called every time your component re-render as they're still regular functions. Whether or not your callback gets called is totally determined by the rules of useEffect.
Let's say you have a useState which returns a setter that we named setValue. If we call setValue outside of any function in our component, it would cause a re-render issue.
I haven't had the issue of having a limit with React Hooks. I do, however; have seen too many re-render issues. If you have an example, that would help narrow down the question.
As far as I understand, hooks will be called every time your component re-render as they're still regular functions. Whether or not your callback gets called is totally determined by the rules of useEffect.
Oh, Right
Re-render issue, I think
I want to know what is caused by and how to solve this
Thanks in advance.
Let's say you have a
useState
which returns a setter that we namedsetValue
. If we callsetValue
outside of any function in our component, it would cause a re-render issue.Another way that would cause this is if two
useEffect
depend on a value that the other updates.For more information, you can look at Rules of Hooks
Thanks,
It really helps me a great deal.
Appreciate you
Thanks, Karl
This really helps me a great deal.
Appreciate your help