15
15
import type { Element } from 'React' ;
16
16
import type { Fiber } from 'ReactFiber' ;
17
17
import type { ReactNodeList } from 'ReactTypes' ;
18
+ import type { ReactNativeBaseComponentViewConfig } from 'ReactNativeViewConfigRegistry' ;
18
19
19
20
const NativeMethodsMixin = require ( 'NativeMethodsMixin' ) ;
20
21
const ReactFiberReconciler = require ( 'ReactFiberReconciler' ) ;
@@ -39,13 +40,15 @@ type Container = number;
39
40
type Instance = {
40
41
_children : Array < Instance | number > ,
41
42
_nativeTag : number ,
43
+ viewConfig : ReactNativeBaseComponentViewConfig ,
42
44
} ;
43
45
type Props = Object ;
44
46
type TextInstance = number ;
45
47
46
- function NativeHostComponent ( tag ) {
48
+ function NativeHostComponent ( tag , viewConfig ) {
47
49
this . _nativeTag = tag ;
48
50
this . _children = [ ] ;
51
+ this . viewConfig = viewConfig ;
49
52
}
50
53
Object . assign ( NativeHostComponent . prototype , NativeMethodsMixin ) ;
51
54
@@ -114,7 +117,7 @@ const NativeRenderer = ReactFiberReconciler({
114
117
rootContainerInstance : Object ,
115
118
internalInstanceHandle : Object
116
119
) : void {
117
- const viewConfig = ReactNativeViewConfigRegistry . get ( type ) ;
120
+ const viewConfig = instance . viewConfig ;
118
121
119
122
precacheFiberNode ( internalInstanceHandle , instance . _nativeTag ) ;
120
123
@@ -161,7 +164,7 @@ const NativeRenderer = ReactFiberReconciler({
161
164
updatePayload , // props
162
165
) ;
163
166
164
- const component = new NativeHostComponent ( tag ) ;
167
+ const component = new NativeHostComponent ( tag , viewConfig ) ;
165
168
166
169
precacheFiberNode ( internalInstanceHandle , tag ) ;
167
170
0 commit comments