renative icon indicating copy to clipboard operation
renative copied to clipboard

Any idea How do I implement TVOS focus guide in renative ?

Open jasmeet447 opened this issue 5 years ago • 3 comments

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!

jasmeet447 avatar Sep 18 '20 11:09 jasmeet447

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 avatar Sep 18 '20 12:09 RicardasN

@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 avatar Oct 05 '20 12:10 jasmeet447

@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.

kasinskas avatar Feb 10 '22 12:02 kasinskas

Closing as answer has been provided

pauliusguzas avatar Aug 08 '23 12:08 pauliusguzas