use this in a react js component

Solutions on MaxInterview for use this in a react js component by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "use this in a react js component"
Zackery
15 Jan 2017
1class MyName extends React.Component {
2	// name property goes here:
3get name() {
4  return 'Anthony';
5}
6
7  render() {
8    return <h1>My name is {this.name}.</h1>;
9  }
10}
11
12ReactDOM.render(<MyName />, document.getElementById('app'));