You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d97ce4a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/flushSync.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,26 +134,26 @@ export default function PrintApp() {
134
134
135
135
---
136
136
137
-
## Troubleshooting {/*troubleshooting*/}
137
+
## トラブルシューティング {/*troubleshooting*/}
138
138
139
-
### I'm getting an error: "flushSync was called from inside a lifecycle method" {/*im-getting-an-error-flushsync-was-called-from-inside-a-lifecycle-method*/}
139
+
### "flushSync was called from inside a lifecycle method" というエラーが出る {/*im-getting-an-error-flushsync-was-called-from-inside-a-lifecycle-method*/}
140
140
141
141
142
-
React cannot`flushSync`in the middle of a render. If you do, it will noop and warn:
Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.
147
147
148
148
</ConsoleBlock>
149
149
150
-
This includes calling `flushSync`inside:
150
+
これには、以下の場所で `flushSync`を呼び出す場合が含まれます。
151
151
152
-
-rendering a component.
153
-
-`useLayoutEffect`or`useEffect`hooks.
154
-
-Class component lifecycle methods.
152
+
-コンポーネントのレンダー中。
153
+
-`useLayoutEffect`または`useEffect`フック内。
154
+
-クラスコンポーネントのライフサイクルメソッド内。
155
155
156
-
For example, calling `flushSync`in an Effect will noop and warn:
`flushSync`can significantly hurt performance, but this particular pattern is even worse for performance. Exhaust all other options before calling `flushSync`in a microtask as an escape hatch.
0 commit comments