Commit e7e0a90
committed
Revert "Fix: flushSync changes priority inside effect (#21122)"
This reverts commit 0e3c7e1.
When called from inside an effect, flushSync cannot synchronously flush
its updates because React is already working. So we fire a warning.
However, we should still change the priority of the updates to sync so
that they flush at the end of the current task.
This only affects useEffect because updates inside useLayoutEffect (and
the rest of the commit phase, like ref callbacks) are already sync.1 parent 7bac760 commit e7e0a90
File tree
3 files changed
+22
-86
lines changed- packages/react-reconciler/src
- __tests__
3 files changed
+22
-86
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1145 | 1155 | | |
1146 | 1156 | | |
1147 | 1157 | | |
| |||
1158 | 1168 | | |
1159 | 1169 | | |
1160 | 1170 | | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1171 | + | |
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1145 | 1155 | | |
1146 | 1156 | | |
1147 | 1157 | | |
| |||
1158 | 1168 | | |
1159 | 1169 | | |
1160 | 1170 | | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1171 | + | |
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| |||
Lines changed: 0 additions & 64 deletions
This file was deleted.
0 commit comments