Post

One of my favorite changes in v19. Callback refs are really good. I'll write another blogpost soon because my recommendation to wrap in useCallback might not be 100% correct.

Yeah, I'm curious about that. I recognize this pattern from SolidJS but I imagine React will run this ref callback on every re-render. Could that be an issue for, say, `document.addEventListener` use cases?

running addEventListener on every render is fine as long as you clean it up ¯\_(ツ)_/¯ often simpler that way anyways. perf-wise it's cheap too

0 reposts2 likes

No replies yet.