I have three props in store and when any one of them changes useEffect runs. So my question is that, Do i need to create different useEffect separately for every props changing?So that only the code related to particular props will work.
I tried only one useEffect with all the props changing.
> useEffect(() => {
> if (loadingResponse) {
> setLoader(true);
> }
>
> checkVerifyLink(verifyPwdLinkResponse);
>
> if (!isEmpty(resetPasswordResponse)) {
> if (resetPasswordResponse.errors) {
> // do something
> }
> } }, [resetPasswordResponse, verifyPwdLinkResponse, loadingResponse]);
Whenever my "loadingResponse" props changes, the other two function also runs which is expected but I also don't want to create 4-5 different useEffect if say i have 4-5 props in my Component.