Skip to content

Instantly share code, notes, and snippets.

@kmagiera
Created July 24, 2018 11:40
Show Gist options
  • Save kmagiera/b92e8689ec6ecde523bace750318481a to your computer and use it in GitHub Desktop.
Save kmagiera/b92e8689ec6ecde523bace750318481a to your computer and use it in GitHub Desktop.
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