This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { message: 'I am Child ' }; | |
} | |
render() { | |
return <div> | |
<p> Child Component</p> | |
<input type="button" value="Print From Child" onClick={this.props.printParent("Mars")} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { message: 'I am Child ' }; | |
this.printChild = this.printChild.bind(this); | |
} | |
render() { | |
return <div> | |
<p> Child Component</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { message: 'I am Child ' }; | |
} | |
render() { | |
return <div> | |
<p> Child Component</p> | |
<input type="button" value="Print From Child Bind" onClick={this.props.printParent.bind(this, "Mars")} /> |
OlderNewer