Skip to content

Commit abacd2f

Browse files
author
Brian Vaughn
committed
Updated ReactNativeFiber HostConfig methods to mirror PR #8563
Also removed the no-longer-necessary viewConfig from the NativeHostComponent. This config can be retrieved when necessary from commitUpdate() thanks to the newly-added type param
1 parent 27a74ca commit abacd2f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/renderers/native/ReactNativeFiber.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ const NativeRenderer = ReactFiberReconciler({
104104

105105
commitUpdate(
106106
instance : Instance,
107+
type : string,
107108
oldProps : Props,
108109
newProps : Props,
109110
rootContainerInstance : Object,
110111
internalInstanceHandle : Object
111112
) : void {
112-
precacheFiberNode(internalInstanceHandle, instance._nativeTag);
113+
const viewConfig = ReactNativeViewConfigRegistry.get(type);
113114

114-
const viewConfig = (instance : any).viewConfig;
115+
precacheFiberNode(internalInstanceHandle, instance._nativeTag);
115116

116117
const updatePayload = ReactNativeAttributePayload.diff(
117118
oldProps,
@@ -157,7 +158,6 @@ const NativeRenderer = ReactFiberReconciler({
157158
);
158159

159160
const component = new NativeHostComponent(tag);
160-
component.viewConfig = viewConfig;
161161

162162
precacheFiberNode(internalInstanceHandle, tag);
163163

@@ -185,6 +185,7 @@ const NativeRenderer = ReactFiberReconciler({
185185

186186
finalizeInitialChildren(
187187
parentInstance : Instance,
188+
type : string,
188189
props : Props,
189190
rootContainerInstance : Container,
190191
) : void {
@@ -251,13 +252,17 @@ const NativeRenderer = ReactFiberReconciler({
251252

252253
prepareUpdate(
253254
instance : Instance,
255+
type : string,
254256
oldProps : Props,
255257
newProps : Props
256258
) : boolean {
257259
return true;
258260
},
259261

260-
removeChild(parentInstance : Instance | Container, child : Instance | TextInstance) : void {
262+
removeChild(
263+
parentInstance : Instance | Container,
264+
child : Instance | TextInstance
265+
) : void {
261266
recursivelyUncacheFiberNode(child);
262267

263268
if (typeof parentInstance === 'number') {
@@ -270,7 +275,7 @@ const NativeRenderer = ReactFiberReconciler({
270275
[0], // removeAtIndices
271276
);
272277
} else {
273-
const children = parentInstance._children
278+
const children = parentInstance._children;
274279
const index = children.indexOf(child);
275280

276281
children.splice(index, 1);

0 commit comments

Comments
 (0)