Open KELEN opened 4 months ago
layout下面的添加 suppressHydrationWarning={true}
{children}src/app/layout.tsx,html 标签添加 suppressHydrationWarning={true},如下:
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
const inter = Inter({ 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" suppressHydrationWarning={true}>
<body className={inter.className}>{children}</body>
</html>
);
}
https://www.kelen.cc/posts/65dd852769df79c10e121e50?admin=true
Nextjs浏览器控制台警告:Warning: Extra attributes from the server: mpa-version,mpa-extension-id,今天启动项目时,发现控制台突然多了个警告。