Skip to content

Instantly share code, notes, and snippets.

@john1jan
Created March 20, 2017 15:27
Show Gist options
  • Save john1jan/25bbcaa93d2fb8e8efcea4b6b6d0070a to your computer and use it in GitHub Desktop.
Save john1jan/25bbcaa93d2fb8e8efcea4b6b6d0070a to your computer and use it in GitHub Desktop.
ParamConstBinding
class App extends React.Component {
constructor(props) {
super(props);
this.state = { message: 'Hello ' };
this.print= this.print.bind(this);
}
render() {
return <div>
<p> Binding Revealed</p>
<input type="button" value="Print" onClick={this.print("Venus")} />
</div>
}
print(planet) {
console.log(this.state.message + planet);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment