Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
index.js
index.html
 


import React from 'react';
import ReactDOM from 'react-dom';

class Football extends React.Component {
  shoot(a) {
    alert(a);
  }
  render() {
    return (
      <button
        onClick={this.shoot.bind(this, "Goal")}
      >Take the shot!</button>
    );
  }
}

ReactDOM.render(<Football />, document.getElementById('root'));

localhost:3000