mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
docs: remove useless dep of React.useMemo (#44914)
This commit is contained in:
@@ -175,8 +175,8 @@ import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';
|
||||
import type Entity from '@ant-design/cssinjs/es/Cache';
|
||||
import { useServerInsertedHTML } from 'next/navigation';
|
||||
|
||||
const StyledComponentsRegistry = ({ children }: { children: React.ReactNode }) => {
|
||||
const cache = React.useMemo<Entity>(() => createCache(), [createCache]);
|
||||
const StyledComponentsRegistry = ({ children }: React.PropsWithChildren) => {
|
||||
const cache = React.useMemo<Entity>(() => createCache(), []);
|
||||
useServerInsertedHTML(() => (
|
||||
<style id="antd" dangerouslySetInnerHTML={{ __html: extractStyle(cache, true) }} />
|
||||
));
|
||||
@@ -203,7 +203,7 @@ export const metadata = {
|
||||
description: 'Generated by create next app',
|
||||
};
|
||||
|
||||
const RootLayout = ({ children }: { children: React.ReactNode }) => (
|
||||
const RootLayout = ({ children }: React.PropsWithChildren) => (
|
||||
<html lang="en">
|
||||
<body className={inter.className}>
|
||||
<StyledComponentsRegistry>{children}</StyledComponentsRegistry>
|
||||
|
||||
@@ -175,8 +175,8 @@ import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';
|
||||
import type Entity from '@ant-design/cssinjs/es/Cache';
|
||||
import { useServerInsertedHTML } from 'next/navigation';
|
||||
|
||||
const StyledComponentsRegistry = ({ children }: { children: React.ReactNode }) => {
|
||||
const cache = React.useMemo<Entity>(() => createCache(), [createCache]);
|
||||
const StyledComponentsRegistry = ({ children }: React.PropsWithChildren) => {
|
||||
const cache = React.useMemo<Entity>(() => createCache(), []);
|
||||
useServerInsertedHTML(() => (
|
||||
<style id="antd" dangerouslySetInnerHTML={{ __html: extractStyle(cache, true) }} />
|
||||
));
|
||||
@@ -203,7 +203,7 @@ export const metadata = {
|
||||
description: 'Generated by create next app',
|
||||
};
|
||||
|
||||
const RootLayout = ({ children }: { children: React.ReactNode }) => (
|
||||
const RootLayout = ({ children }: React.PropsWithChildren) => (
|
||||
<html lang="en">
|
||||
<body className={inter.className}>
|
||||
<StyledComponentsRegistry>{children}</StyledComponentsRegistry>
|
||||
|
||||
Reference in New Issue
Block a user