docs: update next.js docs (#44440)

* Update use-with-next.zh-CN.md

Signed-off-by: lijianan <574980606@qq.com>

* Update use-with-next.en-US.md

Signed-off-by: lijianan <574980606@qq.com>

* Update use-with-next.en-US.md

Signed-off-by: lijianan <574980606@qq.com>

---------

Signed-off-by: lijianan <574980606@qq.com>
This commit is contained in:
lijianan 2023-08-26 23:28:18 +08:00 committed by GitHub
parent 4e9ac02b08
commit e8b5a187e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -171,9 +171,10 @@ If you are using the App Router in Next.js and using antd as your component libr
import React from 'react';
import { StyleProvider, createCache, extractStyle } from '@ant-design/cssinjs';
import { useServerInsertedHTML } from 'next/navigation';
import type Entity from '@ant-design/cssinjs/es/Cache';
const StyledComponentsRegistry = ({ children }: { children: React.ReactNode }) => {
const cache = createCache();
const cache = React.useMemo<Entity>(() => createCache(), [createCache]);
useServerInsertedHTML(() => (
<style id="antd" dangerouslySetInnerHTML={{ __html: extractStyle(cache, true) }} />
));

View File

@ -171,9 +171,10 @@ export default Home;
import React from 'react';
import { StyleProvider, createCache, extractStyle } from '@ant-design/cssinjs';
import { useServerInsertedHTML } from 'next/navigation';
import type Entity from '@ant-design/cssinjs/es/Cache';
const StyledComponentsRegistry = ({ children }: { children: React.ReactNode }) => {
const cache = createCache();
const cache = React.useMemo<Entity>(() => createCache(), [createCache]);
useServerInsertedHTML(() => (
<style id="antd" dangerouslySetInnerHTML={{ __html: extractStyle(cache, true) }} />
));