Skip to content

Instantly share code, notes, and snippets.

@Karthik-B-06
Created May 16, 2020 09:45
Show Gist options
  • Save Karthik-B-06/cfb96006dcc95fb34b01884d0fcea3d2 to your computer and use it in GitHub Desktop.
Save Karthik-B-06/cfb96006dcc95fb34b01884d0fcea3d2 to your computer and use it in GitHub Desktop.
import React from 'react';
import { View, Text, StyleSheet, TextInput } from 'react-native';
const FormField = (props) => {
return (
<View style={styles.formFieldWrapper}>
<Text style={styles.labelText}>{props.label}</Text>
<TextInput
placeholder={props.placeholder}
style={styles.formFieldText}
onChange={(event) => props.handleFormValueChange(props.formKey, event.nativeEvent.text)}
{...props.textInputProps}
/>
</View>
)
}
const styles = StyleSheet.create({
formFieldWrapper: {
},
formFieldText: {
fontSize: 20,
borderRadius: 15,
borderWidth: 1,
padding: 12
},
labelText: {
fontSize: 20,
marginBottom: 12,
paddingLeft: 10,
paddingTop: 10
}
})
export default FormField;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment