|
5 | 5 | {% endif %}
|
6 | 6 |
|
7 | 7 | {% if not reactpy_failure %}
|
8 |
| -<div id="{{ reactpy_uuid }}" class="{{ reactpy_class }}"></div> |
| 8 | +{% if reactpy_class %}<div id="{{reactpy_uuid}}" class="{{reactpy_class}}"></div>{% endif %} |
| 9 | +{% if not reactpy_class %}<div id="{{reactpy_uuid}}"></div>{% endif %} |
| 10 | +{% if reactpy_prerender_html %}<div id="{{reactpy_uuid}}-prerender">{{reactpy_prerender_html|safe}}</div>{% endif %} |
| 11 | +{% if reactpy_offline_html %}<div id="{{reactpy_uuid}}-offline" hidden>{{reactpy_offline_html|safe}}</div>{% endif %} |
9 | 12 | <script type="module" crossorigin="anonymous">
|
10 | 13 | import { mountComponent } from "{% static 'reactpy_django/client.js' %}";
|
11 |
| - const mountElement = document.getElementById("{{ reactpy_uuid }}"); |
| 14 | + const mountElement = document.getElementById("{{reactpy_uuid}}"); |
12 | 15 | mountComponent(
|
13 | 16 | mountElement,
|
14 |
| - "{{ reactpy_host }}", |
15 |
| - "{{ reactpy_url_prefix }}", |
16 |
| - "{{ reactpy_component_path }}", |
17 |
| - "{{ reactpy_resolved_web_modules_path }}", |
18 |
| - Number("{{ reactpy_reconnect_interval }}"), |
19 |
| - Number("{{ reactpy_reconnect_max_interval }}"), |
20 |
| - Number("{{ reactpy_reconnect_max_retries }}"), |
21 |
| - Number("{{ reactpy_reconnect_backoff_multiplier }}"), |
| 17 | + "{{reactpy_host}}", |
| 18 | + "{{reactpy_url_prefix}}", |
| 19 | + "{{reactpy_component_path}}", |
| 20 | + "{{reactpy_resolved_web_modules_path}}", |
| 21 | + Number("{{reactpy_reconnect_interval}}"), |
| 22 | + Number("{{reactpy_reconnect_max_interval}}"), |
| 23 | + Number("{{reactpy_reconnect_max_retries}}"), |
| 24 | + Number("{{reactpy_reconnect_backoff_multiplier}}"), |
22 | 25 | );
|
23 | 26 | </script>
|
24 |
| -{% if reactpy_prerender_html %}<div id="{{ reactpy_uuid }}-prerender">{{ reactpy_prerender_html|safe }}</div>{% endif %} |
25 |
| -{% if reactpy_offline_html %}<div id="{{ reactpy_uuid }}-offline" hidden>{{ reactpy_offline_html|safe }}</div> |
26 |
| -{% endif %} |
27 | 27 | {% endif %}
|
0 commit comments