Lots of insights here about callback refs!
I'd store the id in a ref and check that manually and not depend on useCallback: ``` const idRef = useRef(null); const scroller = (node) => { if (idRef.current === null || idRef.current !== id) { node?.scrollIntoView({ behavior: "smooth" }); idRef.current = id; } }; ```
0 reposts2 likes