From b36505bf06d023472f5bee5b3b0a6db4e1ca428f Mon Sep 17 00:00:00 2001 From: Jorge Luis Calleja Alvarado Date: Fri, 3 Nov 2023 21:48:03 -0700 Subject: [PATCH] fix: fixed types props tabIndex in view and userSelect in text (#41312) Summary: zfrankdesign reported that in RN 0.72.6, they receive warnings that some new props listed in the documents are missing: View tabIndex https://reactnative.dev/docs/view#tabindex-android and Text userSelect https://reactnative.dev/docs/text#userselect. It seems the components accept these props but they were not typed. ## Changelog: [GENERAL] [FIXED] - Missing typings for the props `tabIndex` for **View** and `userSelect` in the **Text** props were added. Pull Request resolved: https://github.com/facebook/react-native/pull/41312 Test Plan: 1. Instantiate a component of type View 1.1. Should add the property tabIndex to the View component. 1.2. Should not see a warning about the missing tabIndex property. 2. Instantiate a component of type Text 2.1. Should add the property userSelect to the Text component. 2.2. Should not see a warning about the missing userSelect property. Reviewed By: NickGerleman Differential Revision: D50982156 Pulled By: lunaleaps fbshipit-source-id: 75b55cfb897738be0cf426912a7c10c7412d5032 --- .../Libraries/Components/View/ViewPropTypes.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts index 888f3073121..20ff434f97b 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts @@ -145,6 +145,17 @@ export interface ViewPropsAndroid { * Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. */ focusable?: boolean | undefined; + + /** + * Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. + * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex + * for more details. + * + * Supports the following values: + * - 0 (View is focusable) + * - -1 (View is not focusable) + */ + tabIndex?: 0 | -1 | undefined; } /**