formerly: v8/chrome at google
🌐 recompiled.dev
so we want folks to just use memo for optimization and then just remove all manual memo after adding the compiler
so we want folks to just use memo for optimization and then just remove all manual memo after adding the compiler
but the compiler could've memoized this callback differently because of heuristics, so it may not be safe to remove this particular useCallback
but the compiler could've memoized this callback differently because of heuristics, so it may not be safe to remove this particular useCallback
```
const idRef = useRef(null);
const scroller = (node) => {
if (idRef.current === null || idRef.current !== id) {
node?.scrollIntoView({ behavior: "smooth" });
idRef.current = id;
}
};
```
```
const idRef = useRef(null);
const scroller = (node) => {
if (idRef.current === null || idRef.current !== id) {
node?.scrollIntoView({ behavior: "smooth" });
idRef.current = id;
}
};
```