Ad

React Stops Rendering With Child Element

- 1 answer

I'm learning React and I'm trying to implement parent/child elements by hands, without copypasting from tutorials. Once I'm adding child element, React stops rendering, the page is blank:

var utmForm = React.createClass({
  render: function() {
    return (
      <form>
        Hello!
        <utmInput />
      </form>
    )
  }
});

var utmInput = React.createClass({
  render: function() {
    return (
      <p>
        Inputs
      </p>
    )
  }
});

ReactDOM.render(React.createElement(utmForm), document.getElementById('container'));

http://jsbin.com/katupa/edit?html,js,output

Can't guess yet why is that. Babel doesn't complain about my code, also no errors in console.

Ad

Answer

According to console errors just change utmForm to UtmForm, utmInput to UtmInput

You can see browser console by pressing ctrl + shift + i and then click on console tab (in firefox and chrome).

Ad
source: stackoverflow.com
Ad