Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 103ed08

Browse files
authored
Remove shouldDeprioritizeSubtree from host config (facebook#19124)
No longer being used.
1 parent 8f05f2b commit 103ed08

17 files changed

+10
-68
lines changed

packages/react-art/src/ReactARTHostConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,6 @@ export function resetTextContent(domElement) {
323323
// Noop
324324
}
325325

326-
export function shouldDeprioritizeSubtree(type, props) {
327-
return false;
328-
}
329-
330326
export function getRootHostContext() {
331327
return NO_CONTEXT;
332328
}

packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ describe('ReactDOMServerPartialHydration', () => {
9191
// once the extra div wrapper is no longer neccessary.
9292
function LegacyHiddenDiv({children, mode}) {
9393
return (
94-
<div
95-
hidden={
96-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
97-
}>
94+
<div hidden={mode === 'hidden'}>
9895
<React.unstable_LegacyHidden
9996
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
10097
{children}

packages/react-dom/src/__tests__/ReactUpdates-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ describe('ReactUpdates', () => {
2929
// once the extra div wrapper is no longer neccessary.
3030
function LegacyHiddenDiv({children, mode}) {
3131
return (
32-
<div
33-
hidden={
34-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
35-
}>
32+
<div hidden={mode === 'hidden'}>
3633
<React.unstable_LegacyHidden
3734
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
3835
{children}

packages/react-dom/src/client/ReactDOMHostConfig.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,6 @@ export function shouldSetTextContent(type: string, props: Props): boolean {
371371
);
372372
}
373373

374-
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
375-
// This is obnoxiously specific so that nobody uses it, but we can still opt
376-
// in via an infra-level userspace abstraction.
377-
return props.hidden === 'unstable-do-not-use-legacy-hidden';
378-
}
379-
380374
export function createTextInstance(
381375
text: string,
382376
rootContainerInstance: Container,

packages/react-native-renderer/src/ReactFabricHostConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,6 @@ export function resetAfterCommit(containerInfo: Container): void {
329329
// Noop
330330
}
331331

332-
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
333-
return false;
334-
}
335-
336332
export function shouldSetTextContent(type: string, props: Props): boolean {
337333
// TODO (bvaughn) Revisit this decision.
338334
// Always returning false simplifies the createInstance() implementation,

packages/react-native-renderer/src/ReactNativeHostConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ export const scheduleTimeout = setTimeout;
248248
export const cancelTimeout = clearTimeout;
249249
export const noTimeout = -1;
250250

251-
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
252-
return false;
253-
}
254-
255251
export function shouldSetTextContent(type: string, props: Props): boolean {
256252
// TODO (bvaughn) Revisit this decision.
257253
// Always returning false simplifies the createInstance() implementation,

packages/react-noop-renderer/src/createReactNoop.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
335335

336336
shouldSetTextContent,
337337

338-
shouldDeprioritizeSubtree(type: string, props: Props): boolean {
339-
return !!props.hidden;
340-
},
341-
342338
createTextInstance(
343339
text: string,
344340
rootContainerInstance: Container,

packages/react-reconciler/src/__tests__/ReactIncremental-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ describe('ReactIncremental', () => {
2828
// once the extra div wrapper is no longer neccessary.
2929
function LegacyHiddenDiv({children, mode}) {
3030
return (
31-
<div
32-
hidden={
33-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
34-
}>
31+
<div hidden={mode === 'hidden'}>
3532
<React.unstable_LegacyHidden
3633
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
3734
{children}

packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ describe('ReactIncrementalErrorHandling', () => {
4949
// once the extra div wrapper is no longer neccessary.
5050
function LegacyHiddenDiv({children, mode}) {
5151
return (
52-
<div
53-
hidden={
54-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
55-
}>
52+
<div hidden={mode === 'hidden'}>
5653
<React.unstable_LegacyHidden
5754
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
5855
{children}

packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ describe('ReactIncrementalSideEffects', () => {
4242
// once the extra div wrapper is no longer neccessary.
4343
function LegacyHiddenDiv({children, mode}) {
4444
return (
45-
<div
46-
hidden={
47-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
48-
}>
45+
<div hidden={mode === 'hidden'}>
4946
<React.unstable_LegacyHidden
5047
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
5148
{children}

packages/react-reconciler/src/__tests__/ReactNewContext-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ describe('ReactNewContext', () => {
4646
// once the extra div wrapper is no longer neccessary.
4747
function LegacyHiddenDiv({children, mode}) {
4848
return (
49-
<div
50-
hidden={
51-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
52-
}>
49+
<div hidden={mode === 'hidden'}>
5350
<React.unstable_LegacyHidden
5451
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
5552
{children}

packages/react-reconciler/src/__tests__/ReactSchedulerIntegration-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ describe('ReactSchedulerIntegration', () => {
5757
// once the extra div wrapper is no longer neccessary.
5858
function LegacyHiddenDiv({children, mode}) {
5959
return (
60-
<div
61-
hidden={
62-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
63-
}>
60+
<div hidden={mode === 'hidden'}>
6461
<React.unstable_LegacyHidden
6562
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
6663
{children}

packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
144144
// once the extra div wrapper is no longer neccessary.
145145
function LegacyHiddenDiv({children, mode}) {
146146
return (
147-
<div
148-
hidden={
149-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
150-
}>
147+
<div hidden={mode === 'hidden'}>
151148
<React.unstable_LegacyHidden
152149
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
153150
{children}

packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ export const appendInitialChild = $$$hostConfig.appendInitialChild;
5151
export const finalizeInitialChildren = $$$hostConfig.finalizeInitialChildren;
5252
export const prepareUpdate = $$$hostConfig.prepareUpdate;
5353
export const shouldSetTextContent = $$$hostConfig.shouldSetTextContent;
54-
export const shouldDeprioritizeSubtree =
55-
$$$hostConfig.shouldDeprioritizeSubtree;
5654
export const createTextInstance = $$$hostConfig.createTextInstance;
5755
export const scheduleTimeout = $$$hostConfig.scheduleTimeout;
5856
export const cancelTimeout = $$$hostConfig.cancelTimeout;

packages/react-refresh/src/__tests__/ReactFresh-test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ describe('ReactFresh', () => {
7979
// once the extra div wrapper is no longer neccessary.
8080
function LegacyHiddenDiv({children, mode}) {
8181
return (
82-
<div
83-
hidden={
84-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
85-
}>
82+
<div hidden={mode === 'hidden'}>
8683
<React.unstable_LegacyHidden
8784
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
8885
{children}

packages/react-test-renderer/src/ReactTestHostConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@ export function shouldSetTextContent(type: string, props: Props): boolean {
218218
return false;
219219
}
220220

221-
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
222-
return false;
223-
}
224-
225221
export function createTextInstance(
226222
text: string,
227223
rootContainerInstance: Container,

packages/react/src/__tests__/ReactDOMTracing-test.internal.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ function loadModules() {
5959
// the extra div wrapper is no longer neccessary.
6060
function LegacyHiddenDiv({children, mode}) {
6161
return (
62-
<div
63-
hidden={
64-
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
65-
}>
62+
<div hidden={mode === 'hidden'}>
6663
<React.unstable_LegacyHidden
6764
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
6865
{children}

0 commit comments

Comments
 (0)