Skip to content

Commit 912e059

Browse files
authored
Handling Text Input: improve example (#4848)
1 parent cbce7a9 commit 912e059

File tree

7 files changed

+49
-14
lines changed

7 files changed

+49
-14
lines changed

docs/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.77/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.78/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.79/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.80/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.81/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

website/versioned_docs/version-0.82/handling-text-input.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ import {Text, TextInput, View} from 'react-native';
1414
const PizzaTranslator = () => {
1515
const [text, setText] = useState('');
1616
return (
17-
<View style={{padding: 10}}>
17+
<View style={{flex: 1, justifyContent: 'center'}}>
1818
<TextInput
19-
style={{height: 40, padding: 5}}
2019
placeholder="Type here to translate!"
2120
onChangeText={newText => setText(newText)}
2221
defaultValue={text}
22+
style={{
23+
height: 40,
24+
padding: 5,
25+
marginHorizontal: 8,
26+
borderWidth: 1,
27+
}}
2328
/>
2429
<Text style={{padding: 10, fontSize: 42}}>
2530
{text

0 commit comments

Comments
 (0)