File tree 2 files changed +11
-3
lines changed
react-native-renderer/src 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 9
9
* @flow strict
10
10
*/
11
11
12
- import type { ElementRef , ElementType , MixedElement } from 'react' ;
12
+ import type {
13
+ Component as ReactComponent ,
14
+ ElementRef ,
15
+ ElementType ,
16
+ MixedElement ,
17
+ RefSetter ,
18
+ } from 'react' ;
13
19
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
14
20
import { type PublicRootInstance } from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
15
21
@@ -135,7 +141,7 @@ declare const ensureNativeMethodsAreSynced: NativeMethods;
135
141
136
142
export type HostInstance = NativeMethods ;
137
143
export type HostComponent < Config : { ...} > = component (
138
- ref : React$ RefSetter< HostInstance > ,
144
+ ref : RefSetter < HostInstance > ,
139
145
...Config
140
146
) ;
141
147
@@ -188,7 +194,8 @@ export type RenderRootOptions = {
188
194
errorInfo : {
189
195
+ componentStack ?: ?string ,
190
196
// $FlowFixMe[unclear-type] unknown props and state.
191
- + errorBoundary ?: ?React$Component < any , any > ,
197
+ // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
198
+ + errorBoundary ?: ?ReactComponent < any , any > ,
192
199
} ,
193
200
) => void ,
194
201
onRecoverableError ?: (
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export type Key = React$Key;
17
17
export type Node = React$Node ;
18
18
export type Context < T > = React$Context < T > ;
19
19
export type Portal = React$Portal ;
20
+ export type RefSetter < - I > = React$RefSetter < I > ;
20
21
export type ElementProps < C > = React$ElementProps < C > ;
21
22
export type ElementConfig < C > = React$ElementConfig < C > ;
22
23
export type ElementRef < C > = React$ElementRef < C > ;
You can’t perform that action at this time.
0 commit comments