Skip to content

Commit

Permalink
fix: add button to test ref functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIhnatsiuk committed Nov 10, 2024
1 parent ce6b3e6 commit a20faad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default function App() {
setTextState({ extracted: '', formatted: '' });
}, []);

const onFocusButtonPress = React.useCallback(() => {
inputRef.current?.focus();
}, []);

return (
<View style={styles.container}>
<Text>extracted value {textState.extracted}</Text>
Expand All @@ -65,6 +69,7 @@ export default function App() {
customNotations={charAlphaNumerics}
/>
<Button title="Clear text" onPress={clearText} />
<Button title="Focus text input" onPress={onFocusButtonPress} />
</View>
);
}
Expand Down

0 comments on commit a20faad

Please sign in to comment.