Skip to content

Commit a172252

Browse files
committed
rules of hooks callout
1 parent 02ce3f4 commit a172252

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/blog/tanstack-start-ssr-performance-600-percent.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ function useRouterState() {
176176

177177
See: [#6497](https://github.com/TanStack/router/pull/6497), [#6482](https://github.com/TanStack/router/pull/6482)
178178

179+
> [!NOTE]
180+
> `isServer` is a build-time constant. This means that the above code is not violating the rules of hooks in React. At runtime, the code will always execute the same branch.
181+
179182
### Measuring the improvements
180183

181184
Taking the example of the `useRouterState` hook, we can see that most of the client-only work was removed from the SSR pass, leading to a ~2x improvement in the total CPU time of this hook.

0 commit comments

Comments
 (0)