Skip to content

Commit e9b4f9d

Browse files
committed
Update useIsClient description
1 parent 0847435 commit e9b4f9d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

usehooks.com/src/content/hooks/useIsClient.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ import HookDescription from "../../components/HookDescription.astro";
1313
import StaticCodeContainer from "../../components/StaticCodeContainer.astro";
1414

1515
<HookDescription name={frontmatter.name}>
16-
The useIsClient hook is useful for determining whether the code is running on
17-
the client-side or server-side. The hook initializes a state variable called
18-
"isClient" and sets its initial value to false. This information can be
19-
utilized in conditional rendering, handling browser-specific behavior, or
20-
making API calls that should only be executed on the client-side.
16+
useIsClient is useful for determining if it's safe to run certain client-only hooks like useMediaQuery or useLocalStorage. It returns a boolean determining if React's useEffect hook has finished running (which means the app is being rendered on the client and it's safe to use browser specific APIs).
2117
</HookDescription>
2218

2319
<div class="reference">

0 commit comments

Comments
 (0)