Frojd / django-react-templatetags

A quick way to add React components to your Django templates.
MIT License
442 stars 38 forks source link

Include a full Django example with react.js included to demonstrate functionality #3

Closed marteinn closed 6 years ago

egoens commented 6 years ago

I second this thought. At the very least, point users to a preferred or suggested method of loading react.js with Django.

Being used to using React with create-react-app and having something work out of the box is much more seamless than including React into an application framework such as Django.

Currently, I'm struggling with accessing ReactDOM which means I'm not able to get React loading into or communicating with your templating solution. I'm attempting to use https://github.com/ezhome/django-webpack-loader but I'm receiving the following error:

Uncaught ReferenceError: ReactDOM is not defined

This error isn't a product of your solution but it would be helpful to know what method of loading React works for you or what you might suggest for users who are interested in using django-react-templatetags.

Thanks for the awesome work.

rinti commented 6 years ago

Hi!

We're using our own webpack config (which is opensource, react-sass-starterkit). Then we include the javascript file in our base.html file like so: base.html.

Let me know if I can help you further.

marteinn commented 6 years ago

I have added this comment in the readme regarding the required ReactDOM exposure, https://github.com/Frojd/django-react-templatetags/commit/9651e6401abe1657591e566a61e1c2d77a41cd20

marteinn commented 6 years ago

In general, this library wont ship with a full React.js implementation, but I think pointing to references is a good idea.