Created
September 19, 2019 04:39
-
-
Save nitaliano/948a366d4bf902c4a89a6a1e39b8e5d5 to your computer and use it in GitHub Desktop.
Example Text Input
This file contains 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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, {Fragment} from 'react'; | |
import { | |
SafeAreaView, | |
StyleSheet, | |
View, | |
Text, | |
StatusBar, | |
requireNativeComponent, | |
Platform, | |
TextInput | |
} from 'react-native'; | |
const NativeTextInput = Platform.OS === 'ios' : requireNativeComponent('ExampleTextInput') : TextInput; | |
const App = () => { | |
return ( | |
<Fragment> | |
<StatusBar barStyle="dark-content" /> | |
<SafeAreaView style={styles.container}> | |
<View style={styles.container}> | |
<NativeTextInput style={styles.input} /> | |
</View> | |
</SafeAreaView> | |
</Fragment> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
input: { | |
width: 200, | |
height: 60, | |
borderColor: 'blue', | |
borderWidth: 1, | |
} | |
}); | |
export default App; |
This file contains 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/RCTSinglelineTextInputViewManager.h> | |
@interface ExampleTextInputManager : RCTSinglelineTextInputViewManager | |
@end |
This file contains 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 "ExampleTextInputManager.h" | |
@implementation ExampleTextInputManager | |
RCT_EXPORT_MODULE() | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment