Skip to content

Commit 525b7ad

Browse files
authored
Add static typing to the FocusZoneNativeComponent defaultTabbableElement type for Fabric usage (#3864)
* Add static typing to the FocusZoneNativeComponent defaultTabbableElement type for fabric usage of the id/nativeID string type * Change files
1 parent 471409f commit 525b7ad

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Add static typing to the FocusZoneNativeComponent defaultTabbableElement type for fabric usage of the id/nativeID string type",
4+
"packageName": "@fluentui-react-native/focus-zone",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/components/FocusZone/src/FocusZoneNativeComponent.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66

77
import type { HostComponent, ViewProps } from 'react-native';
88

9-
import type { Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
9+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
1010
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
1111

12+
import type { UnsafeMixed } from './codegenTypes';
13+
// Should be:
14+
// import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
15+
1216
export interface NativeProps extends ViewProps {
1317
navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
14-
defaultTabbableElement?: Int32;
18+
defaultTabbableElement?: UnsafeMixed;
1519
focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
1620
use2DNavigation?: boolean;
1721
tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Separate .d.ts file to fool codegen, since UnsafeMixed does not existing in the TS types of RN currently.
2+
export type UnsafeMixed = any;

0 commit comments

Comments
 (0)