Last active
October 27, 2015 20:52
-
-
Save aakashns/69aa29406417ed432ce4 to your computer and use it in GitHub Desktop.
Native View for Name cross-platform component.
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
| import React from 'react-native'; | |
| var { | |
| View, | |
| Text, | |
| TextInput, | |
| StyleSheet | |
| } = React; | |
| var NameViewNative = React.createClass({ | |
| render: function() { | |
| var { value, errors, sync, onValueChange } = this.props; | |
| var errorNodes = errors.map((e, i) => | |
| <Text key={i} style={styles.error}>{e}</Text>); | |
| var syncNode = value && | |
| <Text style={styles.sync}>{sync}</Text>; | |
| return ( | |
| <View style={styles.container}> | |
| <Text style={styles.label}>Name</Text> | |
| <TextInput value={value} | |
| style={styles.input} | |
| onChangeText={onValueChange} /> | |
| </View> | |
| ); | |
| } | |
| }); | |
| var styles = StyleSheet.create({ /* Styles go here */ }); | |
| export default NameViewNative; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment