Skip to content

Instantly share code, notes, and snippets.

@aurimasmi
Created July 20, 2020 07:35
Show Gist options
  • Save aurimasmi/401fae7007ea771805fa6753f12b459d to your computer and use it in GitHub Desktop.
Save aurimasmi/401fae7007ea771805fa6753f12b459d to your computer and use it in GitHub Desktop.
const myRef = useRef(null);
const onRef = useCallback(ref => {
if (ref.current) {
myRef.current = ref;
// Do some actions with ref
}
});
return (
<View ref={onRef} />
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment