Skip to content

Commit d6ecfe9

Browse files
committed
🐞 Fix: Type Errors Due To Update
1 parent fd35b87 commit d6ecfe9

File tree

4 files changed

+44
-43
lines changed

4 files changed

+44
-43
lines changed

src/native_components/RNIContextMenuButton/RNIContextMenuButtonNativeComponent.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ import type { HostComponent, ViewProps } from 'react-native';
44

55
// stubs
66
export interface NativeProps extends ViewProps {
7-
isMenuPrimaryAction: boolean;
7+
isMenuPrimaryAction?: boolean;
88

99
// shared props
10-
onDidSetViewID: BubblingEventHandler<{}>;
10+
onDidSetViewID?: BubblingEventHandler<{}>;
1111

1212
// inherited props
13-
menuConfig: string;
14-
isContextMenuEnabled: boolean;
15-
16-
onMenuWillShow: BubblingEventHandler<{}>;
17-
onMenuDidShow: BubblingEventHandler<{}>;
18-
onMenuWillHide: BubblingEventHandler<{}>;
19-
onMenuDidHide: BubblingEventHandler<{}>;
20-
onMenuWillCancel: BubblingEventHandler<{}>;
21-
onMenuDidCancel: BubblingEventHandler<{}>;
22-
onRequestDeferredElement: BubblingEventHandler<{}>;
23-
onPressMenuItem: BubblingEventHandler<{}>;
13+
menuConfig?: string;
14+
isContextMenuEnabled?: boolean;
2415

16+
onMenuWillShow?: BubblingEventHandler<{}>;
17+
onMenuDidShow?: BubblingEventHandler<{}>;
18+
onMenuWillHide?: BubblingEventHandler<{}>;
19+
onMenuDidHide?: BubblingEventHandler<{}>;
20+
onMenuWillCancel?: BubblingEventHandler<{}>;
21+
onMenuDidCancel?: BubblingEventHandler<{}>;
22+
onRequestDeferredElement?: BubblingEventHandler<{}>;
23+
onPressMenuItem?: BubblingEventHandler<{}>;
2524
};
2625

2726
// stubs

src/native_components/RNIContextMenuButton/RNIContextMenuButtonNativeView.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { HostComponent, ViewProps } from 'react-native';
2-
import type { SharedViewEvents, RemapObject } from 'react-native-ios-utilities';
2+
import type { SharedViewEvents, RemapObject, NativeComponentBaseProps } from 'react-native-ios-utilities';
33

44
import {
55
default as RNIContextMenuButtonNativeComponent,
@@ -9,6 +9,9 @@ import {
99
import type { RNIContextMenuNativeViewBaseProps } from '../RNIContextMenuView/RNIContextMenuNativeView';
1010

1111

12+
type RNIContextMenuButtonNativeComponentBaseProps =
13+
NativeComponentBaseProps<RNIContextMenuButtonNativeComponentProps>;
14+
1215
export type RNIContextMenuNativeViewInheritedProps = Pick<RNIContextMenuNativeViewBaseProps,
1316
| 'menuConfig'
1417
| 'isContextMenuEnabled'
@@ -22,14 +25,11 @@ export type RNIContextMenuNativeViewInheritedProps = Pick<RNIContextMenuNativeVi
2225
| 'onPressMenuItem'
2326
>;
2427

25-
type RNIContextMenuButtonNativeComponentBaseProps = Omit<
26-
RNIContextMenuButtonNativeComponentProps,
27-
keyof (ViewProps & SharedViewEvents & RNIContextMenuNativeViewInheritedProps)
28-
>;
29-
30-
export type RNIContextMenuButtonNativeViewBaseProps = RemapObject<RNIContextMenuButtonNativeComponentBaseProps, {
28+
export type RNIContextMenuButtonNativeViewBaseProps = RemapObject<RNIContextMenuButtonNativeComponentBaseProps, ({
3129
isMenuPrimaryAction: boolean;
32-
}>;
30+
} & Required<
31+
RNIContextMenuNativeViewInheritedProps>
32+
)>;
3333

3434
export type RNIContextMenuButtonNativeViewProps =
3535
SharedViewEvents
@@ -39,3 +39,5 @@ export type RNIContextMenuButtonNativeViewProps =
3939

4040
export const RNIContextMenuButtonNativeView =
4141
RNIContextMenuButtonNativeComponent as unknown as HostComponent<RNIContextMenuButtonNativeViewProps>;
42+
43+

src/native_components/RNIContextMenuView/RNIContextMenuNativeView.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { HostComponent, ViewProps } from 'react-native';
2-
import type { SharedViewEvents, RemapObject } from 'react-native-ios-utilities';
2+
import type { SharedViewEvents, RemapObject, NativeComponentBaseProps } from 'react-native-ios-utilities';
33

44
import {
55
default as RNIContextMenuViewNativeComponent,
@@ -11,18 +11,17 @@ import type { MenuConfig } from '../../types/MenuConfig';
1111
import type { MenuPreviewConfig } from '../../types/MenuPreviewConfig';
1212
import type { AuxiliaryPreviewConfigBackwardsCompatible } from '../../types/AuxiliaryPreviewConfigBackwardsCompatible';
1313

14-
1514
type RNIContextMenuViewNativeComponentBaseProps =
16-
Omit<RNIContextMenuViewNativeComponentProps, keyof (ViewProps & SharedViewEvents)>
15+
NativeComponentBaseProps<RNIContextMenuViewNativeComponentProps>;
1716

1817
export type RNIContextMenuNativeViewBaseProps = RemapObject<RNIContextMenuViewNativeComponentBaseProps, {
1918

2019
// Value Props
2120
// -----------
2221

23-
menuConfig?: MenuConfig;
24-
previewConfig?: MenuPreviewConfig;
25-
auxiliaryPreviewConfig?: AuxiliaryPreviewConfigBackwardsCompatible;
22+
menuConfig: MenuConfig;
23+
previewConfig: MenuPreviewConfig;
24+
auxiliaryPreviewConfig: AuxiliaryPreviewConfigBackwardsCompatible;
2625

2726
/**
2827
* On iOS 15+, the `MenuActionConfig.discoverabilityTitle` is no longer

src/native_components/RNIContextMenuView/RNIContextMenuViewNativeComponent.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@ export interface NativeProps extends ViewProps {
99
menuConfig?: string;
1010
previewConfig?: string;
1111
auxiliaryPreviewConfig?: string;
12-
shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle: string;
13-
isContextMenuEnabled: string;
14-
isAuxiliaryPreviewEnabled: string;
15-
shouldPreventLongPressGestureFromPropagating: string;
12+
13+
shouldUseDiscoverabilityTitleAsFallbackValueForSubtitle?: string;
14+
isContextMenuEnabled?: string;
15+
isAuxiliaryPreviewEnabled?: string;
16+
shouldPreventLongPressGestureFromPropagating?: string;
1617

17-
onMenuWillShow: BubblingEventHandler<{}>;
18-
onMenuDidShow: BubblingEventHandler<{}>;
19-
onMenuWillHide: BubblingEventHandler<{}>;
20-
onMenuDidHide: BubblingEventHandler<{}>;
21-
onMenuWillCancel: BubblingEventHandler<{}>;
22-
onMenuDidCancel: BubblingEventHandler<{}>;
23-
onMenuWillCreate: BubblingEventHandler<{}>;
24-
onRequestDeferredElement: BubblingEventHandler<{}>;
25-
onPressMenuItem: BubblingEventHandler<{}>;
26-
onPressMenuPreview: BubblingEventHandler<{}>;
27-
onMenuAuxiliaryPreviewWillShow: BubblingEventHandler<{}>;
28-
onMenuAuxiliaryPreviewDidShow: BubblingEventHandler<{}>;
18+
onMenuWillShow?: BubblingEventHandler<{}>;
19+
onMenuDidShow?: BubblingEventHandler<{}>;
20+
onMenuWillHide?: BubblingEventHandler<{}>;
21+
onMenuDidHide?: BubblingEventHandler<{}>;
22+
onMenuWillCancel?: BubblingEventHandler<{}>;
23+
onMenuDidCancel?: BubblingEventHandler<{}>;
24+
onMenuWillCreate?: BubblingEventHandler<{}>;
25+
onRequestDeferredElement?: BubblingEventHandler<{}>;
26+
onPressMenuItem?: BubblingEventHandler<{}>;
27+
onPressMenuPreview?: BubblingEventHandler<{}>;
28+
onMenuAuxiliaryPreviewWillShow?: BubblingEventHandler<{}>;
29+
onMenuAuxiliaryPreviewDidShow?: BubblingEventHandler<{}>;
2930
};
3031

3132
// stubs

0 commit comments

Comments
 (0)