GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Don't double invoke getDerivedStateFromProps for module pattern (#21193) · react/react@782f689

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberBeginWork.new.js
    • ReactFiberBeginWork.old.js
    • ReactFiberClassComponent.new.js
    • ReactFiberClassComponent.old.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberBeginWork.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.new.js
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ import {
185185
} from './ReactFiberHydrationContext.new';
186186
import {
187187
adoptClassInstance,
188-
applyDerivedStateFromProps,
189188
constructClassInstance,
190189
mountClassInstance,
191190
resumeMountClassInstance,
@@ -1594,16 +1593,6 @@ function mountIndeterminateComponent(
15941593

15951594
initializeUpdateQueue(workInProgress);
15961595

1597-
const getDerivedStateFromProps = Component.getDerivedStateFromProps;
1598-
if (typeof getDerivedStateFromProps === 'function') {
1599-
applyDerivedStateFromProps(
1600-
workInProgress,
1601-
Component,
1602-
getDerivedStateFromProps,
1603-
props,
1604-
);
1605-
}
1606-
16071596
adoptClassInstance(workInProgress, value);
16081597
mountClassInstance(workInProgress, Component, props, renderLanes);
16091598
return finishClassComponent(
Collapse file

‎packages/react-reconciler/src/ReactFiberBeginWork.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.old.js
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ import {
185185
} from './ReactFiberHydrationContext.old';
186186
import {
187187
adoptClassInstance,
188-
applyDerivedStateFromProps,
189188
constructClassInstance,
190189
mountClassInstance,
191190
resumeMountClassInstance,
@@ -1594,16 +1593,6 @@ function mountIndeterminateComponent(
15941593

15951594
initializeUpdateQueue(workInProgress);
15961595

1597-
const getDerivedStateFromProps = Component.getDerivedStateFromProps;
1598-
if (typeof getDerivedStateFromProps === 'function') {
1599-
applyDerivedStateFromProps(
1600-
workInProgress,
1601-
Component,
1602-
getDerivedStateFromProps,
1603-
props,
1604-
);
1605-
}
1606-
16071596
adoptClassInstance(workInProgress, value);
16081597
mountClassInstance(workInProgress, Component, props, renderLanes);
16091598
return finishClassComponent(
Collapse file

‎packages/react-reconciler/src/ReactFiberClassComponent.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.new.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if (__DEV__) {
162162
Object.freeze(fakeInternalInstance);
163163
}
164164

165-
export function applyDerivedStateFromProps(
165+
function applyDerivedStateFromProps(
166166
workInProgress: Fiber,
167167
ctor: any,
168168
getDerivedStateFromProps: (props: any, state: any) => any,
Collapse file

‎packages/react-reconciler/src/ReactFiberClassComponent.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.old.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if (__DEV__) {
162162
Object.freeze(fakeInternalInstance);
163163
}
164164

165-
export function applyDerivedStateFromProps(
165+
function applyDerivedStateFromProps(
166166
workInProgress: Fiber,
167167
ctor: any,
168168
getDerivedStateFromProps: (props: any, state: any) => any,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.