2021-08-27 12:11:24 +00:00
|
|
|
import { Provider } from "next-auth/client";
|
2021-09-22 19:52:38 +00:00
|
|
|
import React from "react";
|
2021-08-27 12:11:24 +00:00
|
|
|
import { QueryClient, QueryClientProvider } from "react-query";
|
|
|
|
import { Hydrate } from "react-query/hydration";
|
|
|
|
|
2021-09-22 19:52:38 +00:00
|
|
|
import { createTelemetryClient, TelemetryProvider } from "@lib/telemetry";
|
|
|
|
|
2021-08-27 12:11:24 +00:00
|
|
|
export const queryClient = new QueryClient();
|
|
|
|
|
|
|
|
const AppProviders: React.FC = (props, pageProps) => {
|
|
|
|
return (
|
|
|
|
<TelemetryProvider value={createTelemetryClient()}>
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
<Hydrate state={pageProps.dehydratedState}>
|
|
|
|
<Provider session={pageProps.session}>{props.children}</Provider>
|
|
|
|
</Hydrate>
|
|
|
|
</QueryClientProvider>
|
|
|
|
</TelemetryProvider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AppProviders;
|