Skip to content

Instantly share code, notes, and snippets.

const [myRef, setRef] = useState(null);
const onRef = useCallback(ref => {
if (ref.current) {
setRef(ref);
}
});
return (
<View ref={onRef} />
const myRef = useRef(null);
const onRef = useCallback(ref => {
if (ref.current) {
myRef.current = ref;
// Do some actions with ref
}
});
return (
date close
24-Apr-07 93.24
25-Apr-07 95.35
26-Apr-07 98.84
27-Apr-07 99.92
30-Apr-07 99.80
1-May-07 99.47
2-May-07 100.39
3-May-07 100.40
4-May-07 100.81