@samitouri / QOS-React-2 / commits / a1cd77db6e

Pass type to areChildrenOffscreen, too

Andrew Clark committed Feb 28, 2017 at 12:29 UTC a1cd77db6ee28e784378576491ec662867358b56
7 files changed +8 -8
src/renderers/art/ReactARTFiber.js
+1 -1
@@ -503,7 +503,7 @@ const ARTRenderer = ReactFiberReconciler({
503 // Noop
504 },
505
506 - areChildrenOffscreen(props : Props) {
506 + areChildrenOffscreen(type, props) {
507 return false;
508 },
509
src/renderers/dom/fiber/ReactDOMFiber.js
+1 -1
@@ -287,7 +287,7 @@ var DOMRenderer = ReactFiberReconciler({
287 domElement.textContent = '';
288 },
289
290 - areChildrenOffscreen(props : Props) : boolean {
290 + areChildrenOffscreen(type : string, props : Props) : boolean {
291 return Boolean(props.hidden);
292 },
293
src/renderers/native/ReactNativeFiber.js
+1 -1
@@ -343,7 +343,7 @@ const NativeRenderer = ReactFiberReconciler({
343 // Noop
344 },
345
346 - areChildrenOffscreen(props : Props) : boolean {
346 + areChildrenOffscreen(type : string, props : Props) : boolean {
347 return false;
348 },
349
src/renderers/noop/ReactNoop.js
+1 -1
@@ -101,7 +101,7 @@ var NoopRenderer = ReactFiberReconciler({
101
102 resetTextContent(instance : Instance) : void {},
103
104 - areChildrenOffscreen(props : Props) : boolean {
104 + areChildrenOffscreen(type : string, props : Props) : boolean {
105 return Boolean(props.hidden);
106 },
107
src/renderers/shared/fiber/ReactFiberBeginWork.js
+2 -2
@@ -358,7 +358,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
358 }
359 } else if (nextProps === null || memoizedProps === nextProps) {
360 if (!useSyncScheduling &&
361 - areChildrenOffscreen(memoizedProps) &&
361 + areChildrenOffscreen(workInProgress.type, memoizedProps) &&
362 workInProgress.pendingWorkPriority !== OffscreenPriority) {
363 // This subtree still has work, but it should be deprioritized so we need
364 // to bail out and not do any work yet.
@@ -400,7 +400,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
400 markRef(current, workInProgress);
401
402 if (!useSyncScheduling &&
403 - areChildrenOffscreen(nextProps) &&
403 + areChildrenOffscreen(workInProgress.type, nextProps) &&
404 workInProgress.pendingWorkPriority !== OffscreenPriority) {
405 // If this host component is hidden, we can bail out on the children.
406 // We'll rerender the children later at the lower priority.
src/renderers/shared/fiber/ReactFiberReconciler.js
+1 -1
@@ -83,7 +83,7 @@ export type HostConfig<T, P, I, TI, PI, C, CX, PL> = {
83
84 shouldSetTextContent(props : P) : boolean,
85 resetTextContent(instance : I) : void,
86 - areChildrenOffscreen(props : P) : boolean,
86 + areChildrenOffscreen(type : T, props : P) : boolean,
87
88 createTextInstance(
89 text : string,
src/renderers/testing/ReactTestRendererFiber.js
+1 -1
@@ -150,7 +150,7 @@ var TestRenderer = ReactFiberReconciler({
150 // noop
151 },
152
153 - areChildrenOffscreen(props : Props) : boolean {
153 + areChildrenOffscreen(type: string, props : Props) : boolean {
154 return false;
155 },
156