You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useFacetEffect(()=>{console.log('I will never fire'},[],[])
The effect will never fire, because useFacetEffect expects for all facets to resolve to a value before firing the effect. In this case, there are no facets to resolve in the second dependency array, so it will just never fire at all.
In a way this scenario doesn't make sense (we should use useEffect instead) but since there's no way to enforce that empty arrays are not allowed, we should fail gracefully. Instead of never firing, useFacetEffect with an empty facet array should just behave in exactly the same way as a regular useEffect. This, we think, would be the expected behavior.
This issue applies also to a similar scenario in useFacetCallback. We should fix that one as well in the same way.
The text was updated successfully, but these errors were encountered:
Right now, if we run:
The effect will never fire, because
useFacetEffect
expects for all facets to resolve to a value before firing the effect. In this case, there are no facets to resolve in the second dependency array, so it will just never fire at all.In a way this scenario doesn't make sense (we should use
useEffect
instead) but since there's no way to enforce that empty arrays are not allowed, we should fail gracefully. Instead of never firing,useFacetEffect
with an empty facet array should just behave in exactly the same way as a regularuseEffect
. This, we think, would be the expected behavior.This issue applies also to a similar scenario in
useFacetCallback
. We should fix that one as well in the same way.The text was updated successfully, but these errors were encountered: