Created
July 20, 2020 07:37
-
-
Save aurimasmi/804151b000ed60676148c17e9f180370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [myRef, setRef] = useState(null); | |
const onRef = useCallback(ref => { | |
if (ref.current) { | |
setRef(ref); | |
} | |
}); | |
return ( | |
<View ref={onRef} /> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment