title: Data passed as props is not shown in django and reactjs
body: <p>I wanted to pass if username is authenticated or not from django template inside script tag which renders data for reactjs page so that i can use react router for routing user to login or logout. For this i did as below but no luck . I could not fetch value using this.props inside my react page.I get an error in console as "Uncaught TypeError: Cannot read property 'isUserAuthenticated' of undefined". What have i done wrong ? Sorry for my english if i could not explain clearly . I hope my code might enlighten you what I am trying to do.</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>{% load  staticfiles future i18n account rental_tags %}
      &lt;div id="homepage"&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript" src="{% static 'build/js/app.js'%}"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        var data = {
              isUserAuthenticated:{% if request.user.is_authenticated %}true{% else %}false{% endif %}
          };
  
      $(function() {
  
        app.showHomePage("homepage",data);
      });
  
      &lt;/script&gt;
  </code></pre>
  
  <p>index.js(entry point for webpack)</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import Homepage from 'homepage/Homepage';
  
   window.app = {
          showHomePage: function(id,data){
          ReactDOM.render(
            &lt;Homepage /&gt;, document.getElementById(id,data)
          );
  }
  </code></pre>
  
  <p><strong>Homepage.js</strong></p>
  
  <pre><code>import React from 'react';
  import Navbar from './components/Navbar';
  import Body from './components/Body';
  class Homepage extends React.Component {
    render() {
      console.log(this.props.data.isUserAuthenticated);
      return (
              &lt;div className="layer"&gt;
                &lt;Navbar /&gt;
                &lt;Body /&gt;
              &lt;/div&gt;
        );
    }
  }
  
  export default Homepage;
          }
      }
  </code></pre>