Last active
March 19, 2019 00:59
-
-
Save vish448/1de2fab4d9039752b5bc0788245f70cd to your computer and use it in GitHub Desktop.
How to pass props to one class components to another
This file contains hidden or 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
//Parent component | |
class Parent extends React.Component { | |
render() { | |
return ( | |
<Child example="foo" /> | |
) | |
} | |
} | |
//Child Component | |
class Child extends React.component { | |
render() { | |
return ( | |
<h1>{this.props.example}</h1> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment