Skip to content

Commit

Permalink
Merge pull request facebook#8557 from bvaughn/add-create-text-instanc…
Browse files Browse the repository at this point in the history
…e-param

Add rootContainerInstance param to createTextInstance
  • Loading branch information
bvaughn authored Dec 12, 2016
2 parents 92665e2 + f8cb22a commit 0a3256a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/renderers/art/ReactARTFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const ARTRenderer = ReactFiberReconciler({
return instance;
},

createTextInstance(text, internalInstanceHandle) {
createTextInstance(text, rootContainerInstance, internalInstanceHandle) {
return text;
},

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/dom/fiber/ReactDOMFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var DOMRenderer = ReactFiberReconciler({
domElement.textContent = '';
},

createTextInstance(text : string, internalInstanceHandle : Object) : TextInstance {
createTextInstance(text : string, rootContainerInstance : Container, internalInstanceHandle : Object) : TextInstance {
var textNode : TextInstance = document.createTextNode(text);
precacheFiberNode(internalInstanceHandle, textNode);
return textNode;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/noop/ReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var NoopRenderer = ReactFiberReconciler({

resetTextContent(instance : Instance) : void {},

createTextInstance(text : string) : TextInstance {
createTextInstance(text : string, rootContainerInstance : Container, internalInstanceHandle : Object) : TextInstance {
var inst = { text : text, id: instanceCounter++ };
// Hide from unit tests
Object.defineProperty(inst, 'id', { value: inst.id, enumerable: false });
Expand Down
3 changes: 2 additions & 1 deletion src/renderers/shared/fiber/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ module.exports = function<T, P, I, TI, C, CX>(
return null;
}
}
const textInstance = createTextInstance(newText, workInProgress);
const rootContainerInstance = getRootHostContainer();
const textInstance = createTextInstance(newText, rootContainerInstance, workInProgress);
workInProgress.stateNode = textInstance;
}
workInProgress.memoizedProps = newText;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shared/fiber/ReactFiberReconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type HostConfig<T, P, I, TI, C, CX> = {
shouldSetTextContent(props : P) : boolean,
resetTextContent(instance : I) : void,

createTextInstance(text : string, internalInstanceHandle : OpaqueNode) : TI,
createTextInstance(text : string, rootContainerInstance : C, internalInstanceHandle : OpaqueNode) : TI,
commitTextUpdate(textInstance : TI, oldText : string, newText : string) : void,

appendChild(parentInstance : I | C, child : I | TI) : void,
Expand Down

0 comments on commit 0a3256a

Please sign in to comment.