Program to use Component in ReactJs

Posted by Rajnilari2015 under JavaScript category on | Points: 40 | Views : 1302
A component is that feature of React which comprises of an html along with it's associated JS satisfying the SRP principle.React components implement a render() method that takes input data as Component and returns the string after rendering as what to display. e.g.

<div id="mountNode"></div>
var CustomMessage = React.createClass({
render: function() {
return <div>Hello {}</div>;

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


Hello DNF

Comments or Responses

Login to post response