You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a function that post-processes markdown text to inject images. It will only run correctly on the client, so I use placeholders on the server. This function is called htmlImageIdReplacementHack.
Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) ta-reactid="56"><p><a href="/cfs/files/i
(server) ta-reactid="56"><p></p><div style="width
If I use onSSR={<i>Loading...</i>} instead everything is fine.
The text was updated successfully, but these errors were encountered:
I found the cause of the issue:
Apparently the onSSR block is evaluated on the client too and it only works if the onSSR block yields the same result on the server and on the client. I added a weird flag to my htmlImageIdReplacementHack function and then use Meteor.isServer || simulateSSR in there, but that sounds far from ideal to me.
To resolve this in a generic way, how about requiring that component props (onSSR), be wrapped in a callback so they aren't evaluated unless it's needed?
I have a function that post-processes markdown text to inject images. It will only run correctly on the client, so I use placeholders on the server. This function is called
htmlImageIdReplacementHack
.This code throws the following warning:
If I use
onSSR={<i>Loading...</i>}
instead everything is fine.The text was updated successfully, but these errors were encountered: