Skip to content

Commit 6cd478e

Browse files
committed
StoreHydratedGate [nfc]: Tighten up code
1 parent 046f451 commit 6cd478e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/boot/StoreHydratedGate.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ type Props = $ReadOnly<{|
1414
* Where we prevent everything from rendering while waiting for rehydration.
1515
*/
1616
export default function StoreHydratedGate(props: Props): Node {
17-
const isHydrated = useGlobalSelector(getIsHydrated);
18-
1917
const { children } = props;
2018

21-
if (!isHydrated) {
22-
return <FullScreenLoading />;
23-
}
19+
const isHydrated = useGlobalSelector(getIsHydrated);
2420

25-
return children;
21+
return isHydrated ? children : <FullScreenLoading />;
2622
}

0 commit comments

Comments
 (0)