Next.js Discord

Discord Forum

supabase real time channel no longer picking up postgres_changes after moving the provider to layout

Unanswered
Saint Hubert Jura Hound posted this in #help-forum
Open in Discord
Original message was deleted.

1 Reply

Saint Hubert Jura Hound
im using nextjs 14 and this is how im using the context in the layout:
export default async function ServerLayout({ children, params }: ServerLayoutProps) {
    const supabase = createSupabaseServerClient()

    const { data: server } = await getServer(supabase, params.id)

    return (
        <div className="flex h-full bg-cyan-900">
            <div className="m-auto flex h-[92%] w-[92%] rounded-lg bg-primary p-2">
                <HydrationBoundary state={dehydrate(queryClient)}>
                    <ServerProvider initialData={server}>
                        {/* // HydrationBoundary is a Client Component, so hydration will happen there. */}
                        <ControlPanel className="">{children}</ControlPanel>
                    </ServerProvider>
                </HydrationBoundary>
            </div>
        </div>
    )
}