mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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.
This commit is contained in:
@@ -446,7 +446,7 @@ const ARTRenderer = ReactFiberReconciler({
|
||||
return instance;
|
||||
},
|
||||
|
||||
createTextInstance(text, internalInstanceHandle) {
|
||||
createTextInstance(text, rootContainerInstance, internalInstanceHandle) {
|
||||
return text;
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user