Skip to content

Commit cc6fb4b

Browse files
authored
fix(expo): remove iOS codegen warnings from native auth views (#8800)
1 parent df4619f commit cc6fb4b

4 files changed

Lines changed: 18 additions & 23 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/expo": patch
3+
---
4+
5+
Remove React Native codegen warnings from Expo native auth components on iOS.
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
2-
// These deep imports from react-native internals are required by codegen.
3-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4-
import type { HostComponent, ViewProps } from 'react-native';
5-
import type { BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
6-
/* eslint-enable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
1+
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
2+
import { requireNativeComponent } from 'react-native';
73

84
type AuthEvent = Readonly<{ type: string }>;
5+
type AuthEventHandler = (event: NativeSyntheticEvent<AuthEvent>) => void | Promise<void>;
96

107
interface NativeProps extends ViewProps {
118
mode?: string;
129
isDismissible?: boolean;
13-
onAuthEvent?: BubblingEventHandler<AuthEvent>;
10+
onAuthEvent?: AuthEventHandler;
1411
}
1512

16-
export default codegenNativeComponent<NativeProps>('ClerkAuthView') as HostComponent<NativeProps>;
13+
export default requireNativeComponent<NativeProps>('ClerkAuthView');
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
2-
// These deep imports from react-native internals are required by codegen.
3-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4-
import type { HostComponent, ViewProps } from 'react-native';
5-
/* eslint-enable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
1+
import type { ViewProps } from 'react-native';
2+
import { requireNativeComponent } from 'react-native';
63

7-
// Codegen requires an interface declaration here; a type alias fails Android codegen.
84
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
95
interface NativeProps extends ViewProps {}
106

11-
export default codegenNativeComponent<NativeProps>('ClerkUserButtonView') as HostComponent<NativeProps>;
7+
export default requireNativeComponent<NativeProps>('ClerkUserButtonView');
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
2-
// These deep imports from react-native internals are required by codegen.
3-
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4-
import type { HostComponent, ViewProps } from 'react-native';
5-
import type { BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
6-
/* eslint-enable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member, simple-import-sort/imports */
1+
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
2+
import { requireNativeComponent } from 'react-native';
73

84
type ProfileEvent = Readonly<{ type: string }>;
5+
type ProfileEventHandler = (event: NativeSyntheticEvent<ProfileEvent>) => void | Promise<void>;
96

107
interface NativeProps extends ViewProps {
118
isDismissible?: boolean;
12-
onProfileEvent?: BubblingEventHandler<ProfileEvent>;
9+
onProfileEvent?: ProfileEventHandler;
1310
}
1411

15-
export default codegenNativeComponent<NativeProps>('ClerkUserProfileView') as HostComponent<NativeProps>;
12+
export default requireNativeComponent<NativeProps>('ClerkUserProfileView');

0 commit comments

Comments
 (0)