mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
areChildrenOffscreen -> shouldDeprioritizeSubtree
This commit is contained in:
committed by
Andrew Clark
parent
a1cd77db6e
commit
737dac4f03
@@ -503,7 +503,7 @@ const ARTRenderer = ReactFiberReconciler({
|
||||
// Noop
|
||||
},
|
||||
|
||||
areChildrenOffscreen(type, props) {
|
||||
shouldDeprioritizeSubtree(type, props) {
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ const NativeRenderer = ReactFiberReconciler({
|
||||
// Noop
|
||||
},
|
||||
|
||||
areChildrenOffscreen(type : string, props : Props) : boolean {
|
||||
shouldDeprioritizeSubtree(type : string, props : Props) : boolean {
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user