Last active
February 23, 2017 22:30
Star
You must be signed in to star a gist
Base template for react pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "ui/base.html" %} | |
{% block title %}{{title}}{% endblock %} | |
{% block inner %} | |
<div id="react"> | |
<!-- Contents get replaced by mounted React.Component --> | |
<i class="fa fa-lg fa-spinner fa-spin"></i><br><br> | |
<i class="pending">Loading components...</i><br><br> | |
</div> | |
<script> | |
window.props = {{props|json}}; // make sure to escape your props to prevent XSS! See here for the source for the json filter: https://gist.github.com/pirate/c18bfe4fd96008ffa0aef25001a2e88f | |
window.react_mount = document.getElementById('react'); | |
</script> | |
<script src="/static/src/{{component}}"></script> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment