Skip to content

Commit

Permalink
docs: update next.js docs (ant-design#44440)
Browse files Browse the repository at this point in the history
* Update use-with-next.zh-CN.md

Signed-off-by: lijianan <[email protected]>

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

Signed-off-by: lijianan <[email protected]>

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

Signed-off-by: lijianan <[email protected]>

---------

Signed-off-by: lijianan <[email protected]>
  • Loading branch information
li-jia-nan authored Aug 26, 2023
1 parent 4e9ac02 commit e8b5a18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/react/use-with-next.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) }} />
));
Expand Down
3 changes: 2 additions & 1 deletion docs/react/use-with-next.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) }} />
));
Expand Down

0 comments on commit e8b5a18

Please sign in to comment.