Open pbeshai opened 11 years ago
I like the idea - something like a barebones HTML template skeleton?
That would be helpful. I came to this project looking for a way to allow me to use React for server-side rendering, which seems to involve writing the entire page template in React, but not being able to include the doctype is a bit unfortunate.
@pbeshai You can always write a static HTML template and include the React markup within it, just not with react-page (you'd use plain old React + whatever server you want)
@petehunt I am currently doing that with Django running as the backend, but was considering switching to a nodejs backend if I could get the advantages of server-side rendering. Not sure how I do that without replicating the work done in react-page, but I admittedly have never looked into server-side js template rendering before.
Check out https://github.com/petehunt/django-reactify/blob/master/django_reactify/__init__.py
Instead of returning the http response you could put the content right in a template.
@petehunt I think I misinterpreted you earlier - I am not including my React JSX code in my templates -- I mount them from a compiled js file. Django-reactify looks very interesting, I'll take a look. Thanks!
There does not appear to be any way to add in a doctype to React pages. The included example SiteBoilerPlate does not include any, and at least I cannot figure out how to modify the JSX to allow it. Perhaps this could be an option for the react-page-middleware if JSX/React is insufficient?