Skip to content

Commit

Permalink
Move GrazProvider children outside of ClientOnly component
Browse files Browse the repository at this point in the history
This change allows the Next.js app to work with SSR. When the {children} in GrazProvider is a child of <ClientOnly> component, it's not rendered in the Next.js server, so the client never receives the page with the content initially, only after the client-side js is loaded. 

Signed-off-by: Berk Cambaz <[email protected]>
  • Loading branch information
berkcambaz authored Aug 21, 2024
1 parent d558200 commit 900f671
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/graz/src/provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const GrazProvider: FC<GrazProviderProps> = ({ children, grazOptions, ...

return (
<QueryClientProvider key="graz-provider" client={queryClient} {...props}>
{children}
<ClientOnly>
{children}
<GrazEvents />
</ClientOnly>
</QueryClientProvider>
Expand Down

0 comments on commit 900f671

Please sign in to comment.