Skip to content

Commit c9f6d0a

Browse files
authored
Sync ReactNativeTypes from React Native (#21015)
1 parent f8979e0 commit c9f6d0a

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

packages/react-native-renderer/src/ReactFabric.js

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function findHostInstance_DEPRECATED<TElementType: ElementType>(
9797
// Fabric
9898
return (hostInstance: any).canonical;
9999
}
100+
// $FlowFixMe[incompatible-return]
100101
return hostInstance;
101102
}
102103

packages/react-native-renderer/src/ReactFabricHostConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class ReactFabricHostComponent {
187187
}
188188

189189
// eslint-disable-next-line no-unused-expressions
190-
(ReactFabricHostComponent.prototype: NativeMethods);
190+
(ReactFabricHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
191191

192192
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMutation';
193193
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';

packages/react-native-renderer/src/ReactNativeFiberHostComponent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ class ReactNativeFiberHostComponent {
127127
}
128128

129129
// eslint-disable-next-line no-unused-expressions
130-
(ReactNativeFiberHostComponent.prototype: NativeMethods);
130+
(ReactNativeFiberHostComponent.prototype: $ReadOnly<{...NativeMethods, ...}>);
131131

132132
export default ReactNativeFiberHostComponent;

packages/react-native-renderer/src/ReactNativeRenderer.js

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function findHostInstance_DEPRECATED(
9696
// Fabric
9797
return (hostInstance: any).canonical;
9898
}
99+
// $FlowFixMe[incompatible-return]
99100
return hostInstance;
100101
}
101102

packages/react-native-renderer/src/ReactNativeTypes.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type PartialViewConfig = $ReadOnly<{
9494
validAttributes?: PartialAttributeConfiguration,
9595
}>;
9696

97-
export type NativeMethods = {
97+
export type NativeMethods = $ReadOnly<{|
9898
blur(): void,
9999
focus(): void,
100100
measure(callback: MeasureOnSuccessCallback): void,
@@ -105,8 +105,7 @@ export type NativeMethods = {
105105
onFail?: () => void,
106106
): void,
107107
setNativeProps(nativeProps: {...}): void,
108-
...
109-
};
108+
|}>;
110109

111110
export type HostComponent<T> = AbstractComponent<T, $ReadOnly<NativeMethods>>;
112111

0 commit comments

Comments
 (0)