@samitouri / QOS-React-2 / commits / 4fa20b53b7

Don't pass instanceHandle to clones (#13125)

We will instead just reuse the first one.

Sebastian Markbåge committed Aug 16, 2018 at 09:54 UTC 4fa20b53b75f1a59706a949e50c023f08fd191a2
3 files changed +10 -31
packages/react-native-renderer/src/ReactFabricHostConfig.js
+4 -12
@@ -351,23 +351,15 @@ export function cloneInstance(
351 let clone;
352 if (keepChildren) {
353 if (updatePayload !== null) {
354 - clone = cloneNodeWithNewProps(
355 - node,
356 - updatePayload,
357 - internalInstanceHandle,
358 - );
354 + clone = cloneNodeWithNewProps(node, updatePayload);
355 } else {
360 - clone = cloneNode(node, internalInstanceHandle);
356 + clone = cloneNode(node);
357 }
358 } else {
359 if (updatePayload !== null) {
364 - clone = cloneNodeWithNewChildrenAndProps(
365 - node,
366 - updatePayload,
367 - internalInstanceHandle,
368 - );
360 + clone = cloneNodeWithNewChildrenAndProps(node, updatePayload);
361 } else {
370 - clone = cloneNodeWithNewChildren(node, internalInstanceHandle);
362 + clone = cloneNodeWithNewChildren(node);
363 }
364 }
365 return {
packages/react-native-renderer/src/__mocks__/FabricUIManager.js
+4 -12
@@ -50,7 +50,7 @@ const RCTFabricUIManager = {
50 viewName,
51 rootTag,
52 props,
53 - instanceHandle,
53 + eventTarget,
54 ) {
55 invariant(
56 !allocatedTags.has(reactTag),
@@ -65,7 +65,7 @@ const RCTFabricUIManager = {
65 children: [],
66 };
67 }),
68 - cloneNode: jest.fn(function cloneNode(node, instanceHandle) {
68 + cloneNode: jest.fn(function cloneNode(node) {
69 return {
70 reactTag: node.reactTag,
71 viewName: node.viewName,
@@ -73,10 +73,7 @@ const RCTFabricUIManager = {
73 children: node.children,
74 };
75 }),
76 - cloneNodeWithNewChildren: jest.fn(function cloneNodeWithNewChildren(
77 - node,
78 - instanceHandle,
79 - ) {
76 + cloneNodeWithNewChildren: jest.fn(function cloneNodeWithNewChildren(node) {
77 return {
78 reactTag: node.reactTag,
79 viewName: node.viewName,
@@ -87,7 +84,6 @@ const RCTFabricUIManager = {
84 cloneNodeWithNewProps: jest.fn(function cloneNodeWithNewProps(
85 node,
86 newPropsDiff,
90 - instanceHandle,
87 ) {
88 return {
89 reactTag: node.reactTag,
@@ -97,11 +93,7 @@ const RCTFabricUIManager = {
93 };
94 }),
95 cloneNodeWithNewChildrenAndProps: jest.fn(
100 - function cloneNodeWithNewChildrenAndProps(
101 - node,
102 - newPropsDiff,
103 - instanceHandle,
104 - ) {
96 + function cloneNodeWithNewChildrenAndProps(node, newPropsDiff) {
97 return {
98 reactTag: node.reactTag,
99 viewName: node.viewName,
scripts/flow/react-native-host-hooks.js
+2 -7
@@ -102,20 +102,15 @@ declare module 'FabricUIManager' {
102 props: ?Object,
103 eventTarget: Object,
104 ): Object;
105 - declare function cloneNode(node: Object, instanceHandle: Object): Object;
106 - declare function cloneNodeWithNewChildren(
107 - node: Object,
108 - instanceHandle: Object,
109 - ): Object;
105 + declare function cloneNode(node: Object): Object;
106 + declare function cloneNodeWithNewChildren(node: Object): Object;
107 declare function cloneNodeWithNewProps(
108 node: Object,
109 newProps: ?Object,
113 - instanceHandle: Object,
110 ): Object;
111 declare function cloneNodeWithNewChildrenAndProps(
112 node: Object,
113 newProps: ?Object,
118 - instanceHandle: Object,
114 ): Object;
115 declare function appendChild(node: Object, childNode: Object): void;
116