@@ -35,7 +35,6 @@ import {
3535 enableFundamentalAPI ,
3636 enableSuspenseCallback ,
3737 enableScopeAPI ,
38- enableDoubleInvokingEffects ,
3938} from 'shared/ReactFeatureFlags' ;
4039import {
4140 FunctionComponent ,
@@ -1799,116 +1798,6 @@ function commitResetTextContent(current: Fiber) {
17991798 resetTextContent ( current . stateNode ) ;
18001799}
18011800
1802- function invokeLayoutEffectMountInDEV ( fiber : Fiber ) : void {
1803- if ( __DEV__ && enableDoubleInvokingEffects ) {
1804- switch ( fiber . tag ) {
1805- case FunctionComponent :
1806- case ForwardRef :
1807- case SimpleMemoComponent : {
1808- invokeGuardedCallback (
1809- null ,
1810- commitHookEffectListMount ,
1811- null ,
1812- HookLayout | HookHasEffect ,
1813- fiber ,
1814- ) ;
1815- if ( hasCaughtError ( ) ) {
1816- const mountError = clearCaughtError ( ) ;
1817- captureCommitPhaseError ( fiber , mountError ) ;
1818- }
1819- break ;
1820- }
1821- case ClassComponent : {
1822- const instance = fiber . stateNode ;
1823- invokeGuardedCallback ( null , instance . componentDidMount , instance ) ;
1824- if ( hasCaughtError ( ) ) {
1825- const mountError = clearCaughtError ( ) ;
1826- captureCommitPhaseError ( fiber , mountError ) ;
1827- }
1828- break ;
1829- }
1830- }
1831- }
1832- }
1833-
1834- function invokePassiveEffectMountInDEV ( fiber : Fiber ) : void {
1835- if ( __DEV__ && enableDoubleInvokingEffects ) {
1836- switch ( fiber . tag ) {
1837- case FunctionComponent :
1838- case ForwardRef :
1839- case SimpleMemoComponent : {
1840- invokeGuardedCallback (
1841- null ,
1842- commitHookEffectListMount ,
1843- null ,
1844- HookPassive | HookHasEffect ,
1845- fiber ,
1846- ) ;
1847- if ( hasCaughtError ( ) ) {
1848- const mountError = clearCaughtError ( ) ;
1849- captureCommitPhaseError ( fiber , mountError ) ;
1850- }
1851- break ;
1852- }
1853- }
1854- }
1855- }
1856-
1857- function invokeLayoutEffectUnmountInDEV ( fiber : Fiber ) : void {
1858- if ( __DEV__ && enableDoubleInvokingEffects ) {
1859- switch ( fiber . tag ) {
1860- case FunctionComponent :
1861- case ForwardRef :
1862- case SimpleMemoComponent : {
1863- invokeGuardedCallback (
1864- null ,
1865- commitHookEffectListUnmount ,
1866- null ,
1867- HookLayout | HookHasEffect ,
1868- fiber ,
1869- fiber . return ,
1870- ) ;
1871- if ( hasCaughtError ( ) ) {
1872- const unmountError = clearCaughtError ( ) ;
1873- captureCommitPhaseError ( fiber , unmountError ) ;
1874- }
1875- break ;
1876- }
1877- case ClassComponent : {
1878- const instance = fiber . stateNode ;
1879- if ( typeof instance . componentWillUnmount === 'function' ) {
1880- safelyCallComponentWillUnmount ( fiber , instance ) ;
1881- }
1882- break ;
1883- }
1884- }
1885- }
1886- }
1887-
1888- function invokePassiveEffectUnmountInDEV ( fiber : Fiber ) : void {
1889- if ( __DEV__ && enableDoubleInvokingEffects ) {
1890- switch ( fiber . tag ) {
1891- case FunctionComponent :
1892- case ForwardRef :
1893- case SimpleMemoComponent : {
1894- invokeGuardedCallback (
1895- null ,
1896- commitHookEffectListUnmount ,
1897- null ,
1898- HookPassive | HookHasEffect ,
1899- fiber ,
1900- fiber . return ,
1901- ) ;
1902- if ( hasCaughtError ( ) ) {
1903- const unmountError = clearCaughtError ( ) ;
1904- captureCommitPhaseError ( fiber , unmountError ) ;
1905- }
1906- break ;
1907- }
1908- }
1909- }
1910- }
1911-
19121801export {
19131802 commitBeforeMutationLifeCycles ,
19141803 commitResetTextContent ,
@@ -1918,8 +1807,4 @@ export {
19181807 commitLifeCycles ,
19191808 commitAttachRef ,
19201809 commitDetachRef ,
1921- invokeLayoutEffectMountInDEV ,
1922- invokeLayoutEffectUnmountInDEV ,
1923- invokePassiveEffectMountInDEV ,
1924- invokePassiveEffectUnmountInDEV ,
19251810} ;
0 commit comments