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

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
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:

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

var React = require(‘react’);
var ReactDOM = require(‘react-dom’);

var componentBlueprint = {};

var MyComponentClass = React.createClass({
render: function () {
return

Hello world

;
}
});

ReactDOM.render(
,
document.getElementById(‘app’)
);

<do not remove the three backticks above>

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);
2 Likes

Thanks friend :blush:

1 Like

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