Skip to content

Commit df9d907

Browse files
authored
Fix flushSync.md grammar (#6282)
1 parent 14629a7 commit df9d907

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/reference/react-dom/flushSync.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ import { flushSync } from 'react-dom';
8989

9090
export default function PrintApp() {
9191
const [isPrinting, setIsPrinting] = useState(false);
92-
92+
9393
useEffect(() => {
9494
function handleBeforePrint() {
9595
flushSync(() => {
9696
setIsPrinting(true);
9797
})
9898
}
99-
99+
100100
function handleAfterPrint() {
101101
setIsPrinting(false);
102102
}
@@ -108,7 +108,7 @@ export default function PrintApp() {
108108
window.removeEventListener('afterprint', handleAfterPrint);
109109
}
110110
}, []);
111-
111+
112112
return (
113113
<>
114114
<h1>isPrinting: {isPrinting ? 'yes' : 'no'}</h1>
@@ -122,7 +122,7 @@ export default function PrintApp() {
122122

123123
</Sandpack>
124124

125-
Without `flushSync`, when the print dialog will display `isPrinting` as "no". This is because React batches the updates asynchronously and the print dialog is displayed before the state is updated.
125+
Without `flushSync`, the print dialog will display `isPrinting` as "no". This is because React batches the updates asynchronously and the print dialog is displayed before the state is updated.
126126

127127
<Pitfall>
128128

0 commit comments

Comments
 (0)