Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react-native": ">=0.82.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/InitialWindow-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('InitialWindow', () => {
width: 100,
},
};
const TurboModuleRegistry = require('react-native/Libraries/TurboModule/TurboModuleRegistry');
const { TurboModuleRegistry } = require('react-native');
TurboModuleRegistry.get = jest.fn((name) => {
if (name === 'RNCSafeAreaContext') {
return {
Expand Down
18 changes: 9 additions & 9 deletions src/specs/NativeSafeAreaContext.ts

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: eslint ignored this file, updated it here anyway

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @huntie in case @react-native/no-deep-imports meant to flag/catch this
(when it doesn't import codegenNativeComponent)

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { TurboModule, TurboModuleRegistry } from 'react-native';
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
import type { CodegenTypes } from 'react-native';

export interface Spec extends TurboModule {
getConstants: () => {
initialWindowMetrics?: {
insets: {
top: Double;
right: Double;
bottom: Double;
left: Double;
top: CodegenTypes.Double;
right: CodegenTypes.Double;
bottom: CodegenTypes.Double;
left: CodegenTypes.Double;
};
frame: {
x: Double;
y: Double;
width: Double;
height: Double;
x: CodegenTypes.Double;
y: CodegenTypes.Double;
width: CodegenTypes.Double;
height: CodegenTypes.Double;
};
};
};
Expand Down
26 changes: 11 additions & 15 deletions src/specs/NativeSafeAreaProvider.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import type {
DirectEventHandler,
Double,
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps, HostComponent } from 'react-native';
import { codegenNativeComponent } from 'react-native';
import type { CodegenTypes, ViewProps, HostComponent } from 'react-native';

export type Event = Readonly<{
insets: Readonly<{
top: Double;
right: Double;
bottom: Double;
left: Double;
top: CodegenTypes.Double;
right: CodegenTypes.Double;
bottom: CodegenTypes.Double;
left: CodegenTypes.Double;
}>;
frame: Readonly<{
x: Double;
y: Double;
width: Double;
height: Double;
x: CodegenTypes.Double;
y: CodegenTypes.Double;
width: CodegenTypes.Double;
height: CodegenTypes.Double;
}>;
}>;

export interface NativeProps extends ViewProps {
onInsetsChange?: DirectEventHandler<Event>;
onInsetsChange?: CodegenTypes.DirectEventHandler<Event>;
}

export default codegenNativeComponent<NativeProps>(
Expand Down
7 changes: 3 additions & 4 deletions src/specs/NativeSafeAreaView.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
import type { ViewProps, HostComponent } from 'react-native';
import { codegenNativeComponent } from 'react-native';
import type { CodegenTypes, ViewProps, HostComponent } from 'react-native';

export interface NativeProps extends ViewProps {
mode?: WithDefault<'padding' | 'margin', 'padding'>;
mode?: CodegenTypes.WithDefault<'padding' | 'margin', 'padding'>;
edges?: Readonly<{
top: string;
right: string;
Expand Down