The actual mechanism in React is super simple - just call hydrateRoot(root, <App />)
The tricky part is generating the dehydrated HTML from a legacy django monolith. I ended up adding a JS-based worker to the existing Celery system to pick up the React caching jobs and put the output into Redis
1 1Samuel
@samuel.fm
It’s not quite done yet - quite a few rehydration mismatches, but I literally just pulled an all-nighter to get the basic thing working so that’s a job for another time I think
1 1