Closed Ethorsen closed 2 years ago
Can confirm that - it does not accept a react ref. The TS signature and the docs describe that. The workaround is not that much of a problem, but I am open to PRs.
You should memoize that callback
const handleScrollerRef = useCallback((ref) => {
scrollerRef.current = ref;
}, []);
A react ref created with React.createRef/useRef will spit out an error if given directly to scrollerRef prop;
This will generate an error
Work around for now, give a callback function
https://codesandbox.io/s/long-pine-e9g8g?file=/src/App.js