News for hackers. Stuff that matters.
Re:React Docs Beta – rewritten with hooks and interactive ex... by catlifeonmars on Saturday October 23, 2021 @03:22PM (#28971399)
Makes sense. How about making that the default behavior of React and providing a React.dontMemo(…) API to opt out?
Re:React Docs Beta – rewritten with hooks and interactive ex... by midrus on Sunday October 24, 2021 @01:48PM (#28980244)
Or even better, provide a top level configuration option, like:

ReactDOM.render(element, document.getElementById('root'), {memo: true});

Just dreaming...

Re:React Docs Beta – rewritten with hooks and interactive ex... by catlifeonmars on Monday October 25, 2021 @11:07AM (#28988643)
This one is interesting, because React has a separation between the renderer and the library. There is a different renderer for e.g. react native, or even for the terminal (!!). It’s a little ambiguous where memoization falls (does it belong to the renderer, or to the core?). I totally agree that being able to switch on behavior for an entire tree or subtree would be ideal, but react tends to use components for that as well (e.g. <React.StrictMode>). Perhaps this should be a component, it could even be implemented via the context system.