@TkDodo@sebastienlorber When I played around with Router I couldn’t find a way to leave the existing page mounted while the target page suspends (i.e. treat navigation like a React transition). React Router does work like this but I would love to switch to TSR otherwise
@dmwlff useSyncExternalStore is the best fit for “make a reactive derivative of some external stateful thing” (though AFAIK it still has the downside of deopt from concurrent rendering in some scenarios)
@jamonholmgren You can even process queue items in requestIdleCallback to avoid dropping any frames in the browser (with a max wait time in case there really is no idle time available)
@mjackson@ReactTraining Null components are better than hooks for side-effects in my experience (unless you need to return something). It’s clear they have a side-effect, they can be conditionally rendered and their API is just good old props
@branmcconnell@pawelblaszczyk_ The only way you’ll break things is if you pass in a custom hook which changes at runtime - i.e. itself calls a different sequence of primitive hooks in different renders
@TkDodo@erikras The risk with this is that you won't realise that a prop you pass into the dialog is frozen to when the onClick handler rendered. It's particularly hard to spot with event handlers, e.g.
https://t.co/fmoyBahFa3(<Dialog onClose={() => { if (someLocalState) { ... } }} />)