Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active March 30, 2020 17:04
Show Gist options
  • Save akexorcist/e8e9f2c03337d4aad26af4c353cffba2 to your computer and use it in GitHub Desktop.
Save akexorcist/e8e9f2c03337d4aad26af4c353cffba2 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
import ChildComponent from './ChildComponent'
...
class ParentComponent extends Component {
constructor(props) {
super(props)
this.state = {
buttonVisibility: false
};
}
...
render() {
return (
<React.Fragment>
...
<ChildComponent buttonVisibility={this.state.buttonVisibility} />
</React.Fragment>
)
}
}
export default ParentComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment