Last active
March 30, 2020 17:04
-
-
Save akexorcist/78ea183eea18458ace241518864b21e7 to your computer and use it in GitHub Desktop.
[Parent > Data > Child] ChildComponent - Code Snippet for https://blog.nextzy.me/การส่งข้อมูลระหว่าง-parent-และ-child-componentใน-react-725eb793de7b
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
import React, { Component } from 'react' | |
... | |
class ChildComponent extends Component { | |
... | |
render() { | |
return ( | |
<React.Fragment> | |
... | |
{ | |
(this.props.buttonVisibility) ? <button>Let's do this!</button> : '' | |
} | |
</React.Fragment> | |
) | |
} | |
} | |
export default ChildComponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment