News for hackers. Stuff that matters.
Re:The Useless UseCallback by strogonoff on Monday July 28, 2025 @09:06PM (#44717783)
I think one of the most awkward things about React (stemming from its virtue of being just a JavaScript library, as opposed to a framework with some custom DSL that could handle memoization behind the scenes) is that it has to be stated explicitly that non-primitive props should be memoized. React makes it way too easy to pass someProp={[1, 2, 3]}, yet to me it is always a caller’s bug.
Re:The Useless UseCallback by olejorgenb on Monday July 28, 2025 @11:00PM (#44718493)
Hence react compiler
Re:The Useless UseCallback by strogonoff on Tuesday July 29, 2025 @12:49AM (#44719178)
Does it automatically memo non-primitives?
Re:The Useless UseCallback by olejorgenb on Tuesday July 29, 2025 @08:20AM (#44722409)
IIRC that's the idea