Skip to content

Commit af4cfbf

Browse files
mofeiZfacebook-github-bot
authored andcommitted
repro edge cases for noEmit and module opt-outs (facebook#33144)
Summary: see test fixtures --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33144). * facebook#33146 * facebook#33145 * __->__ facebook#33144 DiffTrain build for [fbe7bc21b9aa00afa230132b3f7eee6d2b5c94a7](facebook/react@fbe7bc2) Reviewed By: jackpope Differential Revision: D74404265 fbshipit-source-id: 8a2fc2856e2da9ca7c63d8d49191c4f9e6b015b9
1 parent 4918b30 commit af4cfbf

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

packages/react-native/Libraries/Renderer/shims/ReactNativeTypes.js

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@
77
* @noformat
88
* @nolint
99
* @flow strict
10-
* @generated SignedSource<<2264e9839602043a41f1e13913b43b0f>>
10+
* @generated SignedSource<<4216c04f5a8c40a833b0146588fab5fa>>
1111
*/
1212

13-
import type {
14-
Component as ReactComponent,
15-
ElementRef,
16-
ElementType,
17-
MixedElement,
18-
} from 'react';
1913
import type {
2014
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
21-
MeasureOnSuccessCallback,
15+
HostInstance as PublicInstance,
2216
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
23-
PublicInstance,
17+
MeasureOnSuccessCallback,
2418
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
2519
PublicRootInstance,
2620
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
2721
PublicTextInstance,
28-
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
22+
} from 'react-native';
23+
24+
import * as React from 'react';
2925

3026
export type AttributeType<T, V> =
3127
| true
@@ -97,8 +93,8 @@ type InspectorDataProps = $ReadOnly<{
9793
}>;
9894

9995
type InspectorDataGetter = (
100-
<TElementType: ElementType>(
101-
componentOrHandle: ElementRef<TElementType> | number,
96+
<TElementType: React.ElementType>(
97+
componentOrHandle: React.ElementRef<TElementType> | number,
10298
) => ?number,
10399
) => $ReadOnly<{
104100
measure: (callback: MeasureOnSuccessCallback) => void,
@@ -141,7 +137,7 @@ export type RenderRootOptions = {
141137
+componentStack?: ?string,
142138
// $FlowFixMe[unclear-type] unknown props and state.
143139
// $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
144-
+errorBoundary?: ?ReactComponent<any, any>,
140+
+errorBoundary?: ?React.Component<any, any>,
145141
},
146142
) => void,
147143
onRecoverableError?: (
@@ -155,11 +151,11 @@ export type RenderRootOptions = {
155151
* Provide minimal Flow typing for the high-level RN API and call it a day.
156152
*/
157153
export type ReactNativeType = {
158-
findHostInstance_DEPRECATED<TElementType: ElementType>(
159-
componentOrHandle: ?(ElementRef<TElementType> | number),
154+
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
155+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
160156
): ?PublicInstance,
161-
findNodeHandle<TElementType: ElementType>(
162-
componentOrHandle: ?(ElementRef<TElementType> | number),
157+
findNodeHandle<TElementType: React.ElementType>(
158+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
163159
): ?number,
164160
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
165161
dispatchCommand(
@@ -169,11 +165,11 @@ export type ReactNativeType = {
169165
): void,
170166
sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
171167
render(
172-
element: MixedElement,
168+
element: React.MixedElement,
173169
containerTag: number,
174170
callback: ?() => void,
175171
options: ?RenderRootOptions,
176-
): ?ElementRef<ElementType>,
172+
): ?React.ElementRef<React.ElementType>,
177173
unmountComponentAtNode(containerTag: number): void,
178174
unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
179175
+unstable_batchedUpdates: <T>(fn: (T) => void, bookkeeping: T) => void,
@@ -184,11 +180,11 @@ export opaque type Node = mixed;
184180
export opaque type InternalInstanceHandle = mixed;
185181

186182
export type ReactFabricType = {
187-
findHostInstance_DEPRECATED<TElementType: ElementType>(
188-
componentOrHandle: ?(ElementRef<TElementType> | number),
183+
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
184+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
189185
): ?PublicInstance,
190-
findNodeHandle<TElementType: ElementType>(
191-
componentOrHandle: ?(ElementRef<TElementType> | number),
186+
findNodeHandle<TElementType: React.ElementType>(
187+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
192188
): ?number,
193189
dispatchCommand(
194190
handle: PublicInstance,
@@ -198,12 +194,12 @@ export type ReactFabricType = {
198194
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
199195
sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
200196
render(
201-
element: MixedElement,
197+
element: React.MixedElement,
202198
containerTag: number,
203199
callback: ?() => void,
204200
concurrentRoot: ?boolean,
205201
options: ?RenderRootOptions,
206-
): ?ElementRef<ElementType>,
202+
): ?React.ElementRef<React.ElementType>,
207203
unmountComponentAtNode(containerTag: number): void,
208204
getNodeFromInternalInstanceHandle(
209205
internalInstanceHandle: InternalInstanceHandle,

0 commit comments

Comments
 (0)