Commit 23ed7bf
committed
Remove warning for dangling passive effects
In legacy mode, a test can get into a situation where passive effects are
"dangling" — an update finished, and scheduled some passive effects,
but the effects don't flush.
This is why React warns if you don't wrap updates in act. The act API is
responsible for flushing passive effects. But there are some cases where
the act API (in legacy roots) intentionally doesn't warn, like updates
that originate from roots and classes. It's possible those updates will
render children that contain useEffect. Because of this, dangling
effects are still possible, and React doesn't warn about it.
So we implemented a second act warning for dangling effects.
However, in concurrent roots, we now enforce that all APIs that schedule
React work must be wrapped in act. There's no scenario where dangling
passive effects can happen that doesn't already trigger the warning for
updates. So the dangling effects warning is redundant.
The warning was never part of a public release. It was only enabled
in concurrent roots.
So we can delete it.1 parent 1961c99 commit 23ed7bf
File tree
5 files changed
+2
-113
lines changed- packages
- react-dom/src/__tests__
- react-reconciler/src
5 files changed
+2
-113
lines changedLines changed: 0 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 101 | | |
115 | 102 | | |
116 | 103 | | |
117 | 104 | | |
118 | 105 | | |
119 | 106 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 107 | | |
139 | 108 | | |
140 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
1676 | 1675 | | |
1677 | 1676 | | |
1678 | 1677 | | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | 1678 | | |
1683 | 1679 | | |
1684 | 1680 | | |
| |||
1704 | 1700 | | |
1705 | 1701 | | |
1706 | 1702 | | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | 1703 | | |
1711 | 1704 | | |
1712 | 1705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
1676 | 1675 | | |
1677 | 1676 | | |
1678 | 1677 | | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | 1678 | | |
1683 | 1679 | | |
1684 | 1680 | | |
| |||
1704 | 1700 | | |
1705 | 1701 | | |
1706 | 1702 | | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | 1703 | | |
1711 | 1704 | | |
1712 | 1705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 100 | + | |
106 | 101 | | |
107 | 102 | | |
108 | 103 | | |
| |||
2860 | 2855 | | |
2861 | 2856 | | |
2862 | 2857 | | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
2867 | | - | |
2868 | | - | |
2869 | | - | |
2870 | | - | |
2871 | | - | |
2872 | | - | |
2873 | | - | |
2874 | | - | |
2875 | | - | |
2876 | | - | |
2877 | | - | |
2878 | | - | |
2879 | | - | |
2880 | | - | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | | - | |
2887 | | - | |
2888 | | - | |
2889 | | - | |
2890 | | - | |
2891 | 2858 | | |
2892 | 2859 | | |
2893 | 2860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 100 | + | |
106 | 101 | | |
107 | 102 | | |
108 | 103 | | |
| |||
2860 | 2855 | | |
2861 | 2856 | | |
2862 | 2857 | | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
2867 | | - | |
2868 | | - | |
2869 | | - | |
2870 | | - | |
2871 | | - | |
2872 | | - | |
2873 | | - | |
2874 | | - | |
2875 | | - | |
2876 | | - | |
2877 | | - | |
2878 | | - | |
2879 | | - | |
2880 | | - | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | | - | |
2887 | | - | |
2888 | | - | |
2889 | | - | |
2890 | | - | |
2891 | 2858 | | |
2892 | 2859 | | |
2893 | 2860 | | |
| |||
0 commit comments