Answers for "use this in a react js component"

0

use this in a react js component

class MyName extends React.Component {
	// name property goes here:
get name() {
  return 'Anthony';
}

  render() {
    return <h1>My name is {this.name}.</h1>;
  }
}

ReactDOM.render(<MyName />, document.getElementById('app'));
Posted by: Guest on September-16-2021

Code answers related to "use this in a react js component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language