You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The installation and configuration section in the docs is missing how to configure this plugin if you're using Next.js 14 and the new App Router.
I got it to work partially by doing the following:
npm install click-to-react-component -D -E
In my app/layout.tsx:
`import type { Metadata } from "next";
import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono";
import { Providers } from "./providers";
import "./styles/globals.css";
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
I would rather install click-to-react-component in devDependencies in package.json; will this break something or will it work just as fine as if I would install it under dependencies?
Just trying to learn as much as possible about these types of tooling.
Thanks!
The text was updated successfully, but these errors were encountered:
Ah great thx, I guessed it was that. but for me it end up on 'column errors' or 'source not found' errors. When I click on components.
Seems like it's kind of only working on some client components.
I am not sure it's ready for next 13+
The installation and configuration section in the docs is missing how to configure this plugin if you're using Next.js 14 and the new App Router.
I got it to work partially by doing the following:
npm install click-to-react-component -D -E
app/layout.tsx
:`import type { Metadata } from "next";
import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono";
import { Providers } from "./providers";
import "./styles/globals.css";
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<body
className={h-full font-sans antialiased
} > <Providers>{children}</Providers> </body> </html> ); }
Then in my
app/providers.tsx
:`// @ts-nocheck
"use client";
import { ClickToComponent } from "click-to-react-component";
import { ThemeProvider } from "next-themes";
export function Providers({ children }) {
return (
<>
< ClickToComponent / >
<ThemeProvider
attribute="class"
themes={["light", "dark", "swiss", "neon"]}
>
{children}
< / ThemeProvider >
</>
);
}`
This works partially. For some component selections I get the following error:
which is already mentioned here: #70
Out of curiosity I've got a couple of questions:
devDependencies
in package.json; will this break something or will it work just as fine as if I would install it underdependencies
?Just trying to learn as much as possible about these types of tooling.
Thanks!
The text was updated successfully, but these errors were encountered: