mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +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 { 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>
|
||||
|
Loading…
Reference in New Issue
Block a user