Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
Created February 17, 2014 20:52
Show Gist options
  • Save hunterloftis/9058885 to your computer and use it in GitHub Desktop.
Save hunterloftis/9058885 to your computer and use it in GitHub Desktop.
/** @jsx React.DOM */
var React = require('react');
module.exports = React.createClass({
render: function() {
<h1>Route: { this.props.route }</h1>
}
});
@hunterloftis
Copy link
Author

Error: Invariant Violation: exports.render(): A valid ReactComponent must be returned. You may have returned null, undefined, an array, or some other invalid object.
    at invariantDev (/Users/hunter/code/recruitr/web/node_modules/react/lib/invariant.js:52:19)
    at null.<anonymous> (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactCompositeComponent.js:1288:48)
    at null.<anonymous> (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactPerf.js:57:21)
    at null.<anonymous> (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactCompositeComponent.js:837:38)
    at null.<anonymous> (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactPerf.js:57:21)
    at membrane.mountComponent (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactCompositeComponent.js:687:41)
    at /Users/hunter/code/recruitr/web/node_modules/react/lib/ReactServerRendering.js:49:30
    at ReactReconcileTransaction.Mixin.perform (/Users/hunter/code/recruitr/web/node_modules/react/lib/Transaction.js:159:20)
    at renderComponentToString (/Users/hunter/code/recruitr/web/node_modules/react/lib/ReactServerRendering.js:48:24)
    at render (/Users/hunter/code/recruitr/web/lib/page.js:18:14)

@paramaggarwal
Copy link

It's not returning the component. It should be :

/**
 * @jsx React.DOM
 */

var React = require('react');

module.exports = React.createClass({
  render: function() {
    return (
      <h1>Route: { this.props.route }</h1>
    );
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment