I'm not sure if a good pattern or not but on previous occasions I've wrote hooks like that:    ```  useSomething = ( ref ) => {     useEffect(() => {       // do something with ref.current.       // useEffect ensures the ref is defined    });  }  ```