@@ -35,7 +35,6 @@ import {
35
35
enableFundamentalAPI ,
36
36
enableSuspenseCallback ,
37
37
enableScopeAPI ,
38
- enableDoubleInvokingEffects ,
39
38
} from 'shared/ReactFeatureFlags' ;
40
39
import {
41
40
FunctionComponent ,
@@ -1799,116 +1798,6 @@ function commitResetTextContent(current: Fiber) {
1799
1798
resetTextContent ( current . stateNode ) ;
1800
1799
}
1801
1800
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
-
1912
1801
export {
1913
1802
commitBeforeMutationLifeCycles ,
1914
1803
commitResetTextContent ,
@@ -1918,8 +1807,4 @@ export {
1918
1807
commitLifeCycles ,
1919
1808
commitAttachRef ,
1920
1809
commitDetachRef ,
1921
- invokeLayoutEffectMountInDEV ,
1922
- invokeLayoutEffectUnmountInDEV ,
1923
- invokePassiveEffectMountInDEV ,
1924
- invokePassiveEffectUnmountInDEV ,
1925
1810
} ;
0 commit comments