From 737dac4f03433ff6e08bc18116ec59566d668c94 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 28 Feb 2017 12:31:48 -0800 Subject: [PATCH] areChildrenOffscreen -> shouldDeprioritizeSubtree --- src/renderers/art/ReactARTFiber.js | 2 +- src/renderers/dom/fiber/ReactDOMFiber.js | 2 +- src/renderers/native/ReactNativeFiber.js | 2 +- src/renderers/noop/ReactNoop.js | 2 +- src/renderers/shared/fiber/ReactFiberBeginWork.js | 6 +++--- src/renderers/shared/fiber/ReactFiberReconciler.js | 2 +- src/renderers/testing/ReactTestRendererFiber.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/renderers/art/ReactARTFiber.js b/src/renderers/art/ReactARTFiber.js index 6d4db7d420..dbd71d1262 100644 --- a/src/renderers/art/ReactARTFiber.js +++ b/src/renderers/art/ReactARTFiber.js @@ -503,7 +503,7 @@ const ARTRenderer = ReactFiberReconciler({ // Noop }, - areChildrenOffscreen(type, props) { + shouldDeprioritizeSubtree(type, props) { return false; }, diff --git a/src/renderers/dom/fiber/ReactDOMFiber.js b/src/renderers/dom/fiber/ReactDOMFiber.js index 390c76bfa5..b872ed68f9 100644 --- a/src/renderers/dom/fiber/ReactDOMFiber.js +++ b/src/renderers/dom/fiber/ReactDOMFiber.js @@ -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); }, diff --git a/src/renderers/native/ReactNativeFiber.js b/src/renderers/native/ReactNativeFiber.js index 4e3b6ea6fb..4278f62f5b 100644 --- a/src/renderers/native/ReactNativeFiber.js +++ b/src/renderers/native/ReactNativeFiber.js @@ -343,7 +343,7 @@ const NativeRenderer = ReactFiberReconciler({ // Noop }, - areChildrenOffscreen(type : string, props : Props) : boolean { + shouldDeprioritizeSubtree(type : string, props : Props) : boolean { return false; }, diff --git a/src/renderers/noop/ReactNoop.js b/src/renderers/noop/ReactNoop.js index c2a229b960..eeab23601d 100644 --- a/src/renderers/noop/ReactNoop.js +++ b/src/renderers/noop/ReactNoop.js @@ -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); }, diff --git a/src/renderers/shared/fiber/ReactFiberBeginWork.js b/src/renderers/shared/fiber/ReactFiberBeginWork.js index b46f8b9e5b..1d1d6a75c1 100644 --- a/src/renderers/shared/fiber/ReactFiberBeginWork.js +++ b/src/renderers/shared/fiber/ReactFiberBeginWork.js @@ -77,7 +77,7 @@ module.exports = function( getPriorityContext : () => PriorityLevel, ) { - const { shouldSetTextContent, useSyncScheduling, areChildrenOffscreen } = config; + const { shouldSetTextContent, useSyncScheduling, shouldDeprioritizeSubtree } = config; const { pushHostContext, @@ -358,7 +358,7 @@ module.exports = function( } } 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( 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. diff --git a/src/renderers/shared/fiber/ReactFiberReconciler.js b/src/renderers/shared/fiber/ReactFiberReconciler.js index eb7268e6d6..17a619e3a9 100644 --- a/src/renderers/shared/fiber/ReactFiberReconciler.js +++ b/src/renderers/shared/fiber/ReactFiberReconciler.js @@ -83,7 +83,7 @@ export type HostConfig = { shouldSetTextContent(props : P) : boolean, resetTextContent(instance : I) : void, - areChildrenOffscreen(type : T, props : P) : boolean, + shouldDeprioritizeSubtree(type : T, props : P) : boolean, createTextInstance( text : string, diff --git a/src/renderers/testing/ReactTestRendererFiber.js b/src/renderers/testing/ReactTestRendererFiber.js index b425ccf554..5eaa94bc49 100644 --- a/src/renderers/testing/ReactTestRendererFiber.js +++ b/src/renderers/testing/ReactTestRendererFiber.js @@ -150,7 +150,7 @@ var TestRenderer = ReactFiberReconciler({ // noop }, - areChildrenOffscreen(type: string, props : Props) : boolean { + shouldDeprioritizeSubtree(type: string, props : Props) : boolean { return false; },