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
When a hook depends on a 'ref' and that ref changes in the component, because it was used in a condition for example that became active after the component was first rendered, the useEffect in the hook doesn't get called. A useEffect in the component itself does. This allows for working around it, but that is not ideal.
exportconstuseSomeHook=(props: SomeHookProps): [React.MutableRefObject<Object3D|null>]=>{constref=useRef<Object3D>(null);useEffect(()=>{// Do something with the ref.current, but this gets never called.},[ref.current]);return[ref];};
The text was updated successfully, but these errors were encountered:
When a hook depends on a 'ref' and that ref changes in the component, because it was used in a condition for example that became active after the component was first rendered, the useEffect in the hook doesn't get called. A useEffect in the component itself does. This allows for working around it, but that is not ideal.
The text was updated successfully, but these errors were encountered: