3 ms·
“The page remembers the click” was the original intent [0], but the latest version of React includes a feature called selective hydration [1] which can hydrate
by tomstuart 4y ago
“The page remembers the click” was the original intent [0], but the latest version of React includes a feature called selective hydration [1] which can hydrate a component synchronously in response to an event if possible (i.e. without replaying the event). Naturally React itself has to be loaded for any of that to work.
[0] https://twitter.com/dan_abramov/status/1200118229697486849 https://twitter.com/dan_abramov/status/1200118229697486849
[1] https://github.com/reactwg/react-18/discussions/130 https://github.com/reactwg/react-18/discussions/130
- xmprt 4y agoFollow up: How does the HTML "remember" the events to replay without any help from Javascript?
- tomstuart 4y agoIt doesn’t. This only works once React itself (i.e. the JavaScript code for the library) has loaded, which usually happens pretty quickly. The user-written React components might not finish loading until much later.