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