mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-19 06:43:16 +08:00
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:
parent
4e9ac02b08
commit
e8b5a187e7
@ -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) }} />
|
||||
));
|
||||
|
@ -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) }} />
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user