Created
July 26, 2018 11:38
-
-
Save kmagiera/7b1f73ca2e175a8ebcf2efd1eedeee84 to your computer and use it in GitHub Desktop.
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
class Composer extends Component { | |
state = { showAccessory: false } | |
componentDidMount() { | |
Keyboard.addListener('keyboardDidShow', () => this.setState({ showAccessory: true })); | |
Keyboard.addListener('keyboardDidHide', () => this.setState({ showAccessory: false })); | |
} | |
render() { | |
return ( | |
<View> | |
<EditTextComponent /> | |
{this.state.showAccessory && <AccessoryView />} | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment