Any idea How do I implement TVOS focus guide in renative ?
Hi, I'm trying to build an application in Renative for TVOS platform. The focusable elements in the application are wrapped up in a Touchable Opacity. I'm not sure how to implement focus guides. Any help will be appreciated!
I suggest looking into @react-native-community/react-native-tvos implementation of FocusGuide and trying to add it to your project using Renative's plugin override features. It's not an easy task, but our solution is not public (although it is based on react-native-tvos project implementation)
https://github.com/react-native-community/react-native-tvos/blob/af56b2ce13e2a7af2062c6a848298850d550c875/React/Views/RCTTVFocusGuideView.m https://github.com/react-native-community/react-native-tvos/blob/af56b2ce13e2a7af2062c6a848298850d550c875/RNTester/js/examples/TVFocusGuide/TVFocusGuideExample.js
@RicardasN, just a quick question: How can I override react-native with react-native-tvos using rnv override in my current project such that it doesn't affect the code for the other platforms? The same code is working fine on LG WebOS, Tizen ad Android TV.
@jasmeet447 I know that this an old issue, but in case it's still relevant, you could try creating a new project with @flexn/template, which already has react-native-tvos engine configured for tvs and automatically switches between tvos and regular react-native based on the platform you're currently running, and moving your src into it - npx rnv new --projectTemplate @flexn/template
If needed this will allow you to import FocusGuide from react-native-tvos as well. Just FYI, we are working on and planning to soon open-source our sdk, which attempts to solve many platform specific issues, especially focus related ones.
Closing as answer has been provided