Skip to content

Commit 9cacfc3

Browse files
authored
More compact template tag HTML (reactive-python#223)
1 parent 162406b commit 9cacfc3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/reactpy_django/templates/reactpy/component.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
{% endif %}
66

77
{% 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 %}
912
<script type="module" crossorigin="anonymous">
1013
import { mountComponent } from "{% static 'reactpy_django/client.js' %}";
11-
const mountElement = document.getElementById("{{ reactpy_uuid }}");
14+
const mountElement = document.getElementById("{{reactpy_uuid}}");
1215
mountComponent(
1316
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}}"),
2225
);
2326
</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 %}
2727
{% endif %}

0 commit comments

Comments
 (0)