User Input - LucyMHall/Fizzy_O GitHub Wiki
Create a text input field
import React, { Component } from 'react';
import { Text, TextInput, View } from 'react-native';
export default class UselessTextInput extends Component {
constructor(props) {
super(props);
this.state = { text: 'Input Text' };
}
render() {
return (
<View style={{
justifyContent: "center", marginLeft: 10, alignItems: "center", display: "flex"}}>
<TextInput
style={{ height: 60, width: 300, borderColor: "magenta", borderWidth: 5, marginTop: 100,
padding: 10, fontWeight: "bold", fontFamily: "Marker Felt" }}
onChangeText={(text) => this.setState({ text })}
value={this.state.text}
/>
</View>
);
}
}
A cross-platform input prompt component for React Native
npm install --save react-native-input-prompt