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

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'));