mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add react query devtools in next template
This commit is contained in:
5
.changeset/afraid-cups-clap.md
Normal file
5
.changeset/afraid-cups-clap.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
add react query devtools in next template
|
||||||
@@ -15,8 +15,8 @@ const geistMono = Geist_Mono({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Create Next App",
|
title: "{{projectName}}",
|
||||||
description: "Generated by create next app",
|
description: "{{projectName}}",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
{{#if (eq backend "convex")}}
|
{{#if (eq backend "convex")}}
|
||||||
import { ConvexProvider, ConvexReactClient } from "convex/react";
|
import { ConvexProvider, ConvexReactClient } from "convex/react";
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#unless (eq api "none")}}
|
{{#unless (eq api "none")}}
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||||
{{#if (eq api "orpc")}}
|
{{#if (eq api "orpc")}}
|
||||||
import { orpc, ORPCContext, queryClient } from "@/utils/orpc";
|
import { orpc, ORPCContext, queryClient } from "@/utils/orpc";
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -12,6 +14,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
import { ThemeProvider } from "./theme-provider";
|
import { ThemeProvider } from "./theme-provider";
|
||||||
import { Toaster } from "./ui/sonner";
|
import { Toaster } from "./ui/sonner";
|
||||||
|
|
||||||
@@ -19,32 +22,33 @@ import { Toaster } from "./ui/sonner";
|
|||||||
const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
export default function Providers({ children, }: { children: React.ReactNode })
|
export default function Providers({ children }: { children: React.ReactNode }) { return (
|
||||||
{ return (
|
<ThemeProvider
|
||||||
<ThemeProvider
|
attribute="class"
|
||||||
attribute="class"
|
defaultTheme="system"
|
||||||
defaultTheme="system"
|
enableSystem
|
||||||
enableSystem
|
disableTransitionOnChange
|
||||||
disableTransitionOnChange
|
>
|
||||||
>
|
{{#if (eq backend "convex")}}
|
||||||
{{#if (eq backend "convex")}}
|
<ConvexProvider client={convex}>{children}</ConvexProvider>
|
||||||
<ConvexProvider client={convex}>{children}</ConvexProvider>
|
{{else}}
|
||||||
{{else}}
|
{{#unless (eq api "none")}}
|
||||||
{{#unless (eq api "none")}}
|
<QueryClientProvider client={queryClient}>
|
||||||
<QueryClientProvider client={queryClient}>
|
{{#if (eq api "orpc")}}
|
||||||
{{#if (eq api "orpc")}}
|
<ORPCContext.Provider value={orpc}>
|
||||||
<ORPCContext.Provider value={orpc}>
|
{children}
|
||||||
{children}
|
</ORPCContext.Provider>
|
||||||
</ORPCContext.Provider>
|
{{/if}}
|
||||||
{{/if}}
|
{{#if (eq api "trpc")}}
|
||||||
{{#if (eq api "trpc")}}
|
{children}
|
||||||
|
{{/if}}
|
||||||
|
<ReactQueryDevtools />
|
||||||
|
</QueryClientProvider>
|
||||||
|
{{else}}
|
||||||
{children}
|
{children}
|
||||||
{{/if}}
|
{{/unless}}
|
||||||
</QueryClientProvider>
|
{{/if}}
|
||||||
{{else}}
|
<Toaster richColors />
|
||||||
{children}
|
</ThemeProvider>
|
||||||
{{/unless}}
|
);
|
||||||
{{/if}}
|
}
|
||||||
<Toaster richColors />
|
|
||||||
</ThemeProvider>
|
|
||||||
) }
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tanstack/react-router-devtools": "^1.114.3",
|
"@tanstack/react-router-devtools": "^1.114.3",
|
||||||
"@tanstack/react-query-devtools": "^5.71.10",
|
|
||||||
"@testing-library/dom": "^10.4.0",
|
"@testing-library/dom": "^10.4.0",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
"@types/react": "^19.0.8",
|
"@types/react": "^19.0.8",
|
||||||
|
|||||||
Reference in New Issue
Block a user