title: Initializing react component from asp.net
body: <p>Hopefully this is a slam-dunk for someone out there...my essential problem is this: I've built up a very nice set of react components which i can render in my asp.net 4.5 mvc 6 application using react.js, flux, gulp, and browserify. </p>
  
  <p>as long as i have it structured so that the react components have all the data they need everything is perfect. My issue now is that I would like to have an MVC view include the react stuff, and inject run-time properties into the top-level component as it is created. Since I'm brpowserify-ing all of my react code into a bundle, i just include the one script tag in my view:</p>
  
  <p><code>&lt;script src="/js/modules/AuthContainer.jsx"&gt;&lt;/script&gt;</code></p>
  
  <p>But whereas I would normally use JSX syntax to instantiate my component with props like this:</p>
  
  <p></p>
  
  <p>...the view in ASP.NET never gets translated to pure JS, so that fails. </p>
  
  <p>I've also tried:</p>
  
  <pre><code>  ReactDOM.render
    (
       React.createElement(AuthContainer, { successPath: '/home' }),
       document.getElementById('reactRoot')
    );
  </code></pre>
  
  <p>...from inside a script block in my view but i get:</p>
  
  <p><code>Uncaught ReferenceError: AuthContainer is not defined</code></p>
  
  <p>But i'm sure i'm exposing 'AuthContainer' via the browserify-ed bundle, so i don't understand why it's unable to resolve that component.</p>
  
  <p>I know there's a React.NET way to do this, but i can't get that server-side rendering to work with my components because I'm using jQuery to fetch data in componentDidMount and the server-side rendering is choking looking for <code>$()</code> jQuery stuff.</p>
  
  <p>I'd love to get the server side rendering going but right now i just need it to do work, one way of the other. Can someone provide a simple code snippet or gist of how to instantiate a React component from inside a cshtml file with run-time props? </p>