9
9
* @flow strict
10
10
*/
11
11
12
- import type {
13
- Component as ReactComponent ,
14
- ElementRef ,
15
- ElementType ,
16
- MixedElement ,
17
- } from 'react' ;
18
12
import type {
19
13
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
20
- MeasureOnSuccessCallback ,
14
+ HostInstance as PublicInstance ,
21
15
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
22
- PublicInstance ,
16
+ MeasureOnSuccessCallback ,
23
17
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
24
18
PublicRootInstance ,
25
19
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
26
20
PublicTextInstance ,
27
- } from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
21
+ } from 'react-native' ;
22
+
23
+ import * as React from 'react' ;
28
24
29
25
export type AttributeType < T , V > =
30
26
| true
@@ -96,8 +92,8 @@ type InspectorDataProps = $ReadOnly<{
96
92
} > ;
97
93
98
94
type InspectorDataGetter = (
99
- < TElementType : ElementType > (
100
- componentOrHandle: ElementRef< TElementType > | number,
95
+ < TElementType : React . ElementType > (
96
+ componentOrHandle: React. ElementRef< TElementType > | number,
101
97
) => ?number ,
102
98
) => $ReadOnly < {
103
99
measure : ( callback : MeasureOnSuccessCallback ) => void ,
@@ -140,7 +136,7 @@ export type RenderRootOptions = {
140
136
+ componentStack ?: ?string ,
141
137
// $FlowFixMe[unclear-type] unknown props and state.
142
138
// $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
143
- + errorBoundary ?: ?ReactComponent < any , any > ,
139
+ + errorBoundary ?: ?React . Component < any , any > ,
144
140
} ,
145
141
) => void ,
146
142
onRecoverableError ?: (
@@ -154,11 +150,11 @@ export type RenderRootOptions = {
154
150
* Provide minimal Flow typing for the high-level RN API and call it a day.
155
151
*/
156
152
export type ReactNativeType = {
157
- findHostInstance_DEPRECATED< TElementType : ElementType > (
158
- componentOrHandle : ?( ElementRef < TElementType > | number ) ,
153
+ findHostInstance_DEPRECATED< TElementType : React . ElementType > (
154
+ componentOrHandle : ?( React . ElementRef < TElementType > | number ) ,
159
155
) : ?PublicInstance ,
160
- findNodeHandle < TElementType : ElementType > (
161
- componentOrHandle : ?( ElementRef < TElementType > | number ) ,
156
+ findNodeHandle < TElementType : React . ElementType > (
157
+ componentOrHandle : ?( React . ElementRef < TElementType > | number ) ,
162
158
) : ?number ,
163
159
isChildPublicInstance ( parent : PublicInstance , child : PublicInstance ) : boolean ,
164
160
dispatchCommand (
@@ -168,11 +164,11 @@ export type ReactNativeType = {
168
164
) : void ,
169
165
sendAccessibilityEvent ( handle : PublicInstance , eventType : string ) : void ,
170
166
render (
171
- element : MixedElement ,
167
+ element : React . MixedElement ,
172
168
containerTag : number ,
173
169
callback : ?( ) => void ,
174
170
options : ?RenderRootOptions ,
175
- ) : ?ElementRef < ElementType> ,
171
+ ) : ?React . ElementRef < React . ElementType> ,
176
172
unmountComponentAtNode ( containerTag : number ) : void ,
177
173
unmountComponentAtNodeAndRemoveContainer ( containerTag : number ) : void ,
178
174
+ unstable_batchedUpdates : < T > (fn: (T) => void , bookkeeping : T ) => void ,
@@ -183,11 +179,11 @@ export opaque type Node = mixed;
183
179
export opaque type InternalInstanceHandle = mixed ;
184
180
185
181
export type ReactFabricType = {
186
- findHostInstance_DEPRECATED < TElementType : ElementType > (
187
- componentOrHandle: ?(ElementRef< TElementType > | number),
182
+ findHostInstance_DEPRECATED < TElementType : React . ElementType > (
183
+ componentOrHandle : ?( React . ElementRef < TElementType > | number ) ,
188
184
) : ?PublicInstance,
189
- findNodeHandle< TElementType : ElementType > (
190
- componentOrHandle: ?(ElementRef< TElementType > | number),
185
+ findNodeHandle < TElementType : React . ElementType > (
186
+ componentOrHandle : ?( React . ElementRef < TElementType > | number ) ,
191
187
) : ?number,
192
188
dispatchCommand (
193
189
handle : PublicInstance ,
@@ -197,12 +193,12 @@ export type ReactFabricType = {
197
193
isChildPublicInstance ( parent : PublicInstance , child : PublicInstance ) : boolean ,
198
194
sendAccessibilityEvent ( handle : PublicInstance , eventType : string ) : void ,
199
195
render (
200
- element: MixedElement,
196
+ element : React . MixedElement ,
201
197
containerTag : number ,
202
198
callback : ?( ) => void ,
203
199
concurrentRoot : ?boolean ,
204
200
options : ?RenderRootOptions ,
205
- ) : ?ElementRef < ElementType > ,
201
+ ) : ?React . ElementRef < React . ElementType> ,
206
202
unmountComponentAtNode ( containerTag : number ) : void ,
207
203
getNodeFromInternalInstanceHandle (
208
204
internalInstanceHandle : InternalInstanceHandle ,
0 commit comments