generated from garronej/ts-ci
-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
I'm currently using Nextjs 15.2.2 with MUI 6.4.7 and tss-react 4.9.15. I am getting the error assert is not defined when calling useStyles() in a component which is marked "use client". I am using Nextjs app router. Am I missing something?
Root layout:
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { AppRouterCacheProvider } from "@mui/material-nextjs/v15-appRouter";
import { ThemeProvider } from "@mui/material/styles";
import theme from "../theme";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<AppRouterCacheProvider options={{ enableCssLayer: true }}>
<ThemeProvider theme={theme}>{children}</ThemeProvider>
</AppRouterCacheProvider>
</body>
</html>
);
}
Button.tsx:
"use client";
import React from "react";
import { tss } from "tss-react/mui";
const useStyles = tss.create({
root: {
color: "red",
},
});
export default function Button() {
const { classes } = useStyles();
return <button className={classes.root}>Click me</button>;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels