React native Application STB(SET-TOP BOX) Focus issues. Unable to use the Focus or blur methods in React Native android Application

42 views Asked by At

i am an android developer and i am trying to develope a Tv Application for the Set-Top box but the React Native OnFocus/ onBlur method inside a Touchables are not working, but yes The focus is moving from one button to another but i am not able to track it or able to give some style to the Focused button, can someone please help.

Can someone please help me with the focus part.

here is some code snippet from my code this is not the full code but this part dosent work

import { Text, View } from "react-native";
import { TouchableNativeFeedback } from "react-native";
import { useRef } from "react";

const Movie = ({}) => {
  const playButton2 = useRef(null); // Add this line
  return (
<View>
            <TouchableNativeFeedback
              ref={playButton2}
              accessible={true}
              background={TouchableNativeFeedback.Ripple("red")}
              onPress={() => console.log("Hi 2")}
            >
              <View style={{ backgroundColor: "white" }}>
                <Text style={{ color: "black" }}>HI Test</Text>
              </View>
            </TouchableNativeFeedback>
          </View>
    </View>
  );
};


0

There are 0 answers