{% load react_json %}

<script>
    {% for component in components %}
        ReactDOM.hydrate(
            React.createElement({{ component.component }},
                {% if component.data %}
                    {% react_render_json component.data %}
                {% else %}
                    null
                {% endif %}),
            document.getElementById('{{ component.identifier }}')
        );
    {% endfor %}
</script>
