7. The Render Function (Por favor, no sean malos!)


Help me please=

Select new.js.

Make some new lines in between var ReactDOM = require('react-dom'); and var MyComponentClass ....
In this new space, declare a new variable named componentBlueprint. Set componentBlueprint's value equal to an empty object literal.

¡Qué tengo malo!.. Aiudaaaaaaaa :slight_smile:

var React = require('react');
var ReactDOM = require('react-dom');

var componentBlueprint = {};

var MyComponentClass = React.createClass({
  render: function () {
    return <h1>Hello world</h1>;

	<MyComponentClass />, 


When we enter the new.js tab, the component class looks like this:

var MyComponentClass = React.createClass();

do not write anything into the class (until the last step). The above render property will get written into the componentBlueprint object:

var componentBlueprint = {
  render: function () {
    return <h1>Hello world</h1>;

Finally, we pass this to the component class:

var MyComponentClass = React.createClass(componentBlueprint);


Thanks friend :blush:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.