Closed
Description
Hey,
great work, thanks for the package.
I want to use it without SSR. The ReactDOM.hydrate
call gives me the following warning in the browser console:
warning.js:33 Warning: Expected server HTML to contain a matching <div> in <div>.
While scanning through that issue on a (I guess comparable) rails package, I guessed using ReactDOM.render
instead will solve the problem: reactjs/react-rails#842
And indeed, it did. I could fix it by overwriting react_print.html
in my templates
folder by:
<script>
{% for component in components %}
ReactDOM.hydrate(
React.createElement({{ component.name }},
{% if component.json %}
{{ component.json|safe }}
{% else %}
null
{% endif %}),
document.getElementById('{{ component.identifier }}')
);
{% endfor %}
</script>
Would there be a simple way to automatically set it to ReactDOM.render
, if SSR is not configured?
Cheers
Lars
Metadata
Metadata
Assignees
Labels
No labels