isomorphic-javascript

Warning: React attempted to reuse markup in a container but the checksum was invalid

耗尽温柔 提交于 2019-11-27 04:13:46
问题 I'm trying to get an isomorphic Node.js, Express, Webpack, React app working. I'm getting the following error. Any suggestions on how to fix it? 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

Render HTML string in isomorphic React app

萝らか妹 提交于 2019-11-27 02:55:55
问题 There is non-SPA scenario with sanitized yet random HTML string as an input: <p>...</p> <p>...</p> <gallery image-ids=""/> <player video-id="..."/> <p>...</p> The string originates from WYSIWYG editor and contains nested regular HTML tags and a limited number of custom elements (components) that should be rendered to widgets. Currently HTML snippets like this one are supposed to be rendered on server side (Express) separately but will eventually be rendered on client side too as a part of