Skip to content

Commit

Permalink
UI & UX Design with InputAccessoryView (facebook#2183)
Browse files Browse the repository at this point in the history
* UI Design with InputAccessoryView 

* Update inputaccessoryview.md

* small tweaks

Co-authored-by: Bartosz Kaszubowski <[email protected]>
  • Loading branch information
mojvan and Simek authored Aug 30, 2020
1 parent b1e5983 commit 0749856
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/inputaccessoryview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Button, InputAccessoryView, ScrollView, TextInput } from 'react-native'
export default App = () => {
const inputAccessoryViewID = 'uniqueID';
const initialText = 'Placeholder Text';
const initialText = '';
const [text, setText] = useState(initialText);
return (
Expand All @@ -22,17 +22,18 @@ export default App = () => {
<TextInput
style={{
padding: 16,
marginTop: 50
marginTop: 50,
}}
inputAccessoryViewID={inputAccessoryViewID}
onChangeText={text => setText(text)}
onChangeText={setText}
value={text}
placeholder={'Please type here…'}
/>
</ScrollView>
<InputAccessoryView nativeID={inputAccessoryViewID}>
<Button
onPress={() => setText(initialText)}
title="Reset Text"
title="Clear text"
/>
</InputAccessoryView>
</>
Expand Down

0 comments on commit 0749856

Please sign in to comment.