/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, {useRef} from 'react';
import {
StyleSheet,
TouchableOpacity,
View,
Text,
AccessibilityInfo,
findNodeHandle,
} from 'react-native';
const App = () => {
const button3Ref = useRef(null);
const changeFocus = () => {
const tag = findNodeHandle(button3Ref.current);
AccessibilityInfo.setAccessibilityFocus(tag);
};
return (
<>
RNChangeFocus
Press to change focus to BUTTON 3
BUTTON 2
BUTTON 3
>
);
};
const styles = StyleSheet.create({
body: {
flex: 1,
justifyContent: 'center',
paddingHorizontal: 10,
},
button: {
alignItems: 'center',
backgroundColor: '#DDDDDD',
padding: 10,
marginBottom: 20,
},
header: {
backgroundColor: '#008577',
paddingHorizontal: 20,
paddingVertical: 20,
},
headerText: {
color: 'white',
},
});
export default App;