File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -12,16 +12,14 @@ export interface AutoFocusGuideProps {
1212const FOCUS_GUIDE_STYLE : ViewStyle = {
1313 width : '100%' ,
1414 justifyContent : 'center' ,
15- alignItems : 'center'
15+ alignItems : 'center' ,
1616} ;
1717
1818const TVFocusGuideView = lazy ( ( ) : Promise < { default : React . ComponentType < any > } > => {
19- if ( Platform . OS === 'ios' && Platform . isTV ) {
20- if ( ReactNative . TVFocusGuideView ) {
21- return Promise . resolve ( { default : ReactNative . TVFocusGuideView } ) ;
22- } else {
23- console . warn ( 'TVFocusGuideView not supported, a dependency on react-native-tvos is required.' ) ;
24- }
19+ if ( ReactNative . TVFocusGuideView ) {
20+ return Promise . resolve ( { default : ReactNative . TVFocusGuideView } ) ;
21+ } else {
22+ console . warn ( 'TVFocusGuideView not supported, a dependency on react-native-tvos is required.' ) ;
2523 }
2624 return Promise . resolve ( { default : ( { children } ) => < > { children } </ > } ) ;
2725} ) ;
@@ -31,9 +29,12 @@ const TVFocusGuideView = lazy((): Promise<{ default: React.ComponentType<any> }>
3129 */
3230export const AutoFocusGuide = ( props : React . PropsWithChildren < AutoFocusGuideProps > ) => {
3331 const { style, children } = props ;
34- return (
35- < TVFocusGuideView autoFocus style = { [ FOCUS_GUIDE_STYLE , style ] } >
36- { children }
37- </ TVFocusGuideView >
38- ) ;
32+ if ( Platform . OS === 'ios' && Platform . isTV ) {
33+ return (
34+ < TVFocusGuideView autoFocus style = { [ FOCUS_GUIDE_STYLE , style ] } >
35+ { children }
36+ </ TVFocusGuideView >
37+ ) ;
38+ }
39+ return < > { children } </ > ;
3940} ;
You can’t perform that action at this time.
0 commit comments