Skip to content

Commit 0749856

Browse files
mojvanSimek
andauthored
UI & UX Design with InputAccessoryView (react#2183)
* UI Design with InputAccessoryView * Update inputaccessoryview.md * small tweaks Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
1 parent b1e5983 commit 0749856

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

docs/inputaccessoryview.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Button, InputAccessoryView, ScrollView, TextInput } from 'react-native'
1313
1414
export default App = () => {
1515
const inputAccessoryViewID = 'uniqueID';
16-
const initialText = 'Placeholder Text';
16+
const initialText = '';
1717
const [text, setText] = useState(initialText);
1818
1919
return (
@@ -22,17 +22,18 @@ export default App = () => {
2222
<TextInput
2323
style={{
2424
padding: 16,
25-
marginTop: 50
25+
marginTop: 50,
2626
}}
2727
inputAccessoryViewID={inputAccessoryViewID}
28-
onChangeText={text => setText(text)}
28+
onChangeText={setText}
2929
value={text}
30+
placeholder={'Please type here…'}
3031
/>
3132
</ScrollView>
3233
<InputAccessoryView nativeID={inputAccessoryViewID}>
3334
<Button
3435
onPress={() => setText(initialText)}
35-
title="Reset Text"
36+
title="Clear text"
3637
/>
3738
</InputAccessoryView>
3839
</>

0 commit comments

Comments
 (0)