@samitouri / QOS-React-2 / commits / f8cb22ad83

Add rootContainerInstance param to createTextInstance.

This mirrors a recent change in params passed to and cleans up a HACK currently required for the native fiber renderer to create text views.

Brian Vaughn committed Dec 12, 2016 at 10:12 UTC f8cb22ad83dca56aca5efd87105d48d2c0fbe423
5 files changed +6 -5
src/renderers/art/ReactARTFiber.js
+1 -1
@@ -446,7 +446,7 @@ const ARTRenderer = ReactFiberReconciler({
446 return instance;
447 },
448
449 - createTextInstance(text, internalInstanceHandle) {
449 + createTextInstance(text, rootContainerInstance, internalInstanceHandle) {
450 return text;
451 },
452
src/renderers/dom/fiber/ReactDOMFiber.js
+1 -1
@@ -152,7 +152,7 @@ var DOMRenderer = ReactFiberReconciler({
152 domElement.textContent = '';
153 },
154
155 - createTextInstance(text : string, internalInstanceHandle : Object) : TextInstance {
155 + createTextInstance(text : string, rootContainerInstance : Container, internalInstanceHandle : Object) : TextInstance {
156 var textNode : TextInstance = document.createTextNode(text);
157 precacheFiberNode(internalInstanceHandle, textNode);
158 return textNode;
src/renderers/noop/ReactNoop.js
+1 -1
@@ -81,7 +81,7 @@ var NoopRenderer = ReactFiberReconciler({
81
82 resetTextContent(instance : Instance) : void {},
83
84 - createTextInstance(text : string) : TextInstance {
84 + createTextInstance(text : string, rootContainerInstance : Container, internalInstanceHandle : Object) : TextInstance {
85 var inst = { text : text, id: instanceCounter++ };
86 // Hide from unit tests
87 Object.defineProperty(inst, 'id', { value: inst.id, enumerable: false });
src/renderers/shared/fiber/ReactFiberCompleteWork.js
+2 -1
@@ -292,7 +292,8 @@ module.exports = function<T, P, I, TI, C, CX>(
292 return null;
293 }
294 }
295 - const textInstance = createTextInstance(newText, workInProgress);
295 + const rootContainerInstance = getRootHostContainer();
296 + const textInstance = createTextInstance(newText, rootContainerInstance, workInProgress);
297 workInProgress.stateNode = textInstance;
298 }
299 workInProgress.memoizedProps = newText;
src/renderers/shared/fiber/ReactFiberReconciler.js
+1 -1
@@ -54,7 +54,7 @@ export type HostConfig<T, P, I, TI, C, CX> = {
54 shouldSetTextContent(props : P) : boolean,
55 resetTextContent(instance : I) : void,
56
57 - createTextInstance(text : string, internalInstanceHandle : OpaqueNode) : TI,
57 + createTextInstance(text : string, rootContainerInstance : C, internalInstanceHandle : OpaqueNode) : TI,
58 commitTextUpdate(textInstance : TI, oldText : string, newText : string) : void,
59
60 appendChild(parentInstance : I | C, child : I | TI) : void,