Skip to content

Commit b5d9f3c

Browse files
author
Brian Vaughn
committed
Re-added 'viewConfig' attribute to NativeHostComponent since it is required by NativeMethodsMixin
1 parent 5b21c53 commit b5d9f3c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/renderers/native/ReactNativeFiber.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import type { Element } from 'React';
1616
import type { Fiber } from 'ReactFiber';
1717
import type { ReactNodeList } from 'ReactTypes';
18+
import type { ReactNativeBaseComponentViewConfig } from 'ReactNativeViewConfigRegistry';
1819

1920
const NativeMethodsMixin = require('NativeMethodsMixin');
2021
const ReactFiberReconciler = require('ReactFiberReconciler');
@@ -39,13 +40,15 @@ type Container = number;
3940
type Instance = {
4041
_children: Array<Instance | number>,
4142
_nativeTag: number,
43+
viewConfig: ReactNativeBaseComponentViewConfig,
4244
};
4345
type Props = Object;
4446
type TextInstance = number;
4547

46-
function NativeHostComponent(tag) {
48+
function NativeHostComponent(tag, viewConfig) {
4749
this._nativeTag = tag;
4850
this._children = [];
51+
this.viewConfig = viewConfig;
4952
}
5053
Object.assign(NativeHostComponent.prototype, NativeMethodsMixin);
5154

@@ -114,7 +117,7 @@ const NativeRenderer = ReactFiberReconciler({
114117
rootContainerInstance : Object,
115118
internalInstanceHandle : Object
116119
) : void {
117-
const viewConfig = ReactNativeViewConfigRegistry.get(type);
120+
const viewConfig = instance.viewConfig;
118121

119122
precacheFiberNode(internalInstanceHandle, instance._nativeTag);
120123

@@ -161,7 +164,7 @@ const NativeRenderer = ReactFiberReconciler({
161164
updatePayload, // props
162165
);
163166

164-
const component = new NativeHostComponent(tag);
167+
const component = new NativeHostComponent(tag, viewConfig);
165168

166169
precacheFiberNode(internalInstanceHandle, tag);
167170

src/renderers/native/ReactNativeViewConfigRegistry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
const invariant = require('invariant');
1616

17-
type ReactNativeBaseComponentViewConfig = {
17+
export type ReactNativeBaseComponentViewConfig = {
1818
validAttributes: Object,
1919
uiViewClassName: string,
2020
propTypes?: Object,

0 commit comments

Comments
 (0)