What does the render() method do in ReactJS?

 Posted by Rajnilari2015 on 12/7/2015 | Category: JavaScript Interview questions | Views: 1951 | Points: 40

It takes input data which is a Component and returns a string to display.e.g.

<div id="mountNode"></div>

var CustomMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;

ReactDOM.render(<CustomMessage name="DNF" />, mountNode);


Hello DNF

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response