I'm attempting to fix this Helmet issue (nfl/react-helmet#149) and had the idea of making the client wait until all instances are mounted before allowing handleStateChangeOnClient to change the DOM. Then on the first render of the client (after SSR), it would only do one client state change which would match the server rendered side effects and thus would leave all the side effects intact. In order to "hydrate" the client like this, I'd need to pass along the number of mounted instances so that the client knows how many components to wait for. I can certainly add a mountedInstances inside of Helmet, but I felt it would be better to perhaps expose this from react-side-effect instead and not duplicate functionality.
I can certainly offer a PR here as well. Please let me know. Thanks!
I'm attempting to fix this Helmet issue (nfl/react-helmet#149) and had the idea of making the client wait until all instances are mounted before allowing
handleStateChangeOnClientto change the DOM. Then on the first render of the client (after SSR), it would only do one client state change which would match the server rendered side effects and thus would leave all the side effects intact. In order to "hydrate" the client like this, I'd need to pass along the number of mounted instances so that the client knows how many components to wait for. I can certainly add amountedInstancesinside of Helmet, but I felt it would be better to perhaps expose this fromreact-side-effectinstead and not duplicate functionality.I can certainly offer a PR here as well. Please let me know. Thanks!