Created
January 2, 2018 05:23
-
-
Save MicroBenz/32749d6ebd34b90682c5d6c1839c61fb to your computer and use it in GitHub Desktop.
IntroToReact
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
// ParentComponent.js | |
export default class ParentComponent extends React.Component { | |
render() { | |
return ( | |
<div> | |
<ChildComponent number={1} /> | |
<ChildComponent number={2} /> | |
<ChildComponent number={3} /> | |
<ChildComponent number={4} /> | |
</div> | |
); | |
} | |
} | |
// ChildComponent.js | |
export default class ChildComponent extends React.Component { | |
render() { | |
return ( | |
<p>This is {this.props.number}</p> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment