GeezerVison is showing github.com — Don't double invoke getDerivedStateFromProps for module pattern (#21193) · react/react@782f689
File treeExpand file treeCollapse file tree Open diff view settings packages/react-reconciler/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.new.js -11Lines changed: 0 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -185,7 +185,6 @@ import { | 185 | 185 | } from './ReactFiberHydrationContext.new'; | 186 | 186 | import { | 187 | 187 | adoptClassInstance, | 188 | | - applyDerivedStateFromProps, | 189 | 188 | constructClassInstance, | 190 | 189 | mountClassInstance, | 191 | 190 | resumeMountClassInstance, | @@ -1594,16 +1593,6 @@ function mountIndeterminateComponent( | 1594 | 1593 |
| 1595 | 1594 | initializeUpdateQueue(workInProgress); | 1596 | 1595 |
| 1597 | | - const getDerivedStateFromProps = Component.getDerivedStateFromProps; | 1598 | | - if (typeof getDerivedStateFromProps === 'function') { | 1599 | | - applyDerivedStateFromProps( | 1600 | | - workInProgress, | 1601 | | - Component, | 1602 | | - getDerivedStateFromProps, | 1603 | | - props, | 1604 | | - ); | 1605 | | - } | 1606 | | - | 1607 | 1596 | adoptClassInstance(workInProgress, value); | 1608 | 1597 | mountClassInstance(workInProgress, Component, props, renderLanes); | 1609 | 1598 | return finishClassComponent( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.old.js -11Lines changed: 0 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -185,7 +185,6 @@ import { | 185 | 185 | } from './ReactFiberHydrationContext.old'; | 186 | 186 | import { | 187 | 187 | adoptClassInstance, | 188 | | - applyDerivedStateFromProps, | 189 | 188 | constructClassInstance, | 190 | 189 | mountClassInstance, | 191 | 190 | resumeMountClassInstance, | @@ -1594,16 +1593,6 @@ function mountIndeterminateComponent( | 1594 | 1593 |
| 1595 | 1594 | initializeUpdateQueue(workInProgress); | 1596 | 1595 |
| 1597 | | - const getDerivedStateFromProps = Component.getDerivedStateFromProps; | 1598 | | - if (typeof getDerivedStateFromProps === 'function') { | 1599 | | - applyDerivedStateFromProps( | 1600 | | - workInProgress, | 1601 | | - Component, | 1602 | | - getDerivedStateFromProps, | 1603 | | - props, | 1604 | | - ); | 1605 | | - } | 1606 | | - | 1607 | 1596 | adoptClassInstance(workInProgress, value); | 1608 | 1597 | mountClassInstance(workInProgress, Component, props, renderLanes); | 1609 | 1598 | return finishClassComponent( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.new.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -162,7 +162,7 @@ if (__DEV__) { | 162 | 162 | Object.freeze(fakeInternalInstance); | 163 | 163 | } | 164 | 164 |
| 165 | | -export function applyDerivedStateFromProps( | | 165 | +function applyDerivedStateFromProps( | 166 | 166 | workInProgress: Fiber, | 167 | 167 | ctor: any, | 168 | 168 | getDerivedStateFromProps: (props: any, state: any) => any, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.old.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -162,7 +162,7 @@ if (__DEV__) { | 162 | 162 | Object.freeze(fakeInternalInstance); | 163 | 163 | } | 164 | 164 |
| 165 | | -export function applyDerivedStateFromProps( | | 165 | +function applyDerivedStateFromProps( | 166 | 166 | workInProgress: Fiber, | 167 | 167 | ctor: any, | 168 | 168 | getDerivedStateFromProps: (props: any, state: any) => any, | |
|