We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @fangpenlin
I just create a new react-native project and I'm tried to implement react-native-key-commands, with not much luck though.
react-native-key-commands
Here is a simple implementation. Am I doing something wrong?
Thanks for your help! :)
import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import KeyCommands, { constants } from '@envoy/react-native-key-commands'; const keyCommandList = [{ input: 'a', keyModifier: constants.keyModifierCommand }]; export default class App extends React.Component { render() { return ( <KeyCommands style={{flex:1}} onKeyCommand={this.onKeyCommand} keyCommands={keyCommandList} > <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> To get started, edit App.js </Text> </View> </KeyCommands> ); } onKeyCommand = (evt) => { console.log(`evt`,evt); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @fangpenlin
I just create a new react-native project and I'm tried to implement
react-native-key-commands
, with not much luck though.Here is a simple implementation. Am I doing something wrong?
Thanks for your help! :)
The text was updated successfully, but these errors were encountered: