areChildrenOffscreen -> shouldDeprioritizeSubtree

This commit is contained in:
Andrew Clark
2017-03-01 10:56:31 -08:00
committed by Andrew Clark
parent a1cd77db6e
commit 737dac4f03
7 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -503,7 +503,7 @@ const ARTRenderer = ReactFiberReconciler({
// Noop
},
areChildrenOffscreen(type, props) {
shouldDeprioritizeSubtree(type, props) {
return false;
},
+1 -1
View File
@@ -287,7 +287,7 @@ var DOMRenderer = ReactFiberReconciler({
domElement.textContent = '';
},
areChildrenOffscreen(type : string, props : Props) : boolean {
shouldDeprioritizeSubtree(type : string, props : Props) : boolean {
return Boolean(props.hidden);
},
+1 -1
View File
@@ -343,7 +343,7 @@ const NativeRenderer = ReactFiberReconciler({
// Noop
},
areChildrenOffscreen(type : string, props : Props) : boolean {
shouldDeprioritizeSubtree(type : string, props : Props) : boolean {
return false;
},
+1 -1
View File
@@ -101,7 +101,7 @@ var NoopRenderer = ReactFiberReconciler({
resetTextContent(instance : Instance) : void {},
areChildrenOffscreen(type : string, props : Props) : boolean {
shouldDeprioritizeSubtree(type : string, props : Props) : boolean {
return Boolean(props.hidden);
},
@@ -77,7 +77,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
getPriorityContext : () => PriorityLevel,
) {
const { shouldSetTextContent, useSyncScheduling, areChildrenOffscreen } = config;
const { shouldSetTextContent, useSyncScheduling, shouldDeprioritizeSubtree } = config;
const {
pushHostContext,
@@ -358,7 +358,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
}
} else if (nextProps === null || memoizedProps === nextProps) {
if (!useSyncScheduling &&
areChildrenOffscreen(workInProgress.type, memoizedProps) &&
shouldDeprioritizeSubtree(workInProgress.type, memoizedProps) &&
workInProgress.pendingWorkPriority !== OffscreenPriority) {
// This subtree still has work, but it should be deprioritized so we need
// to bail out and not do any work yet.
@@ -400,7 +400,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
markRef(current, workInProgress);
if (!useSyncScheduling &&
areChildrenOffscreen(workInProgress.type, nextProps) &&
shouldDeprioritizeSubtree(workInProgress.type, nextProps) &&
workInProgress.pendingWorkPriority !== OffscreenPriority) {
// If this host component is hidden, we can bail out on the children.
// We'll rerender the children later at the lower priority.
@@ -83,7 +83,7 @@ export type HostConfig<T, P, I, TI, PI, C, CX, PL> = {
shouldSetTextContent(props : P) : boolean,
resetTextContent(instance : I) : void,
areChildrenOffscreen(type : T, props : P) : boolean,
shouldDeprioritizeSubtree(type : T, props : P) : boolean,
createTextInstance(
text : string,
@@ -150,7 +150,7 @@ var TestRenderer = ReactFiberReconciler({
// noop
},
areChildrenOffscreen(type: string, props : Props) : boolean {
shouldDeprioritizeSubtree(type: string, props : Props) : boolean {
return false;
},