Tooltip - NextJS 13 #1782
-
Hello :) With NextJS 13 introducing their new app directory (currently in beta), as by default layouts and pages are SSR, I was wondering how Radix Tooltip provider can be used globally over the app? If for example, I wrap in my root layout body my childrens with <Tooltip.Provider> component, I get an error from Next saying that it has to be a client side component as it uses useEffect. import "styles/globals.css";
import * as Tooltip from "@radix-ui/react-tooltip";
interface RootLayoutProps {
children: React.ReactNode;
}
export default function RootLayout({ children }: RootLayoutProps) {
return (
<html lang="en">
<head />
<body className="body">
<Tooltip.Provider>
{children}
</Tooltip.Provider>
</body>
</html>
);
}
Thanks a lot. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hey @louislefebvre, we've yet to add out of the box support for the app directory, in the meantime I'd suggest following the guidance provided in the official next docs as relates to third party packages. |
Beta Was this translation helpful? Give feedback.
Hey @louislefebvre, we've yet to add out of the box support for the app directory, in the meantime I'd suggest following the guidance provided in the official next docs as relates to third party packages.