diff --git a/components/icon/index.en-US.md b/components/icon/index.en-US.md index c02d24dbc3..86d2d8e663 100644 --- a/components/icon/index.en-US.md +++ b/components/icon/index.en-US.md @@ -106,13 +106,14 @@ We added a `createFromIconfontCN` function to help developer use their own icons ```jsx import React from 'react'; +import ReactDOM from 'react-dom/client'; import { createFromIconfontCN } from '@ant-design/icons'; const MyIcon = createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // 在 iconfont.cn 上生成 + scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // generate in iconfont.cn }); -ReactDOM.render(, mountedNode); +ReactDOM.createRoot(mountNode).render(); ``` It creates a component that uses SVG sprites in essence. @@ -153,12 +154,14 @@ module.exports = { ``` ```jsx +import React from 'react'; +import ReactDOM from 'react-dom/client'; import Icon from '@ant-design/icons'; import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file. // in create-react-app: // import { ReactComponent as MessageSvg } from 'path/to/message.svg'; -ReactDOM.render(, mountNode); +ReactDOM.createRoot(mountNode).render(); ``` The following properties are available for the component: diff --git a/components/icon/index.zh-CN.md b/components/icon/index.zh-CN.md index 88f8a9334d..bc6b7be9be 100644 --- a/components/icon/index.zh-CN.md +++ b/components/icon/index.zh-CN.md @@ -101,13 +101,14 @@ getTwoToneColor(); // #eb2f96 ```jsx import React from 'react'; +import ReactDOM from 'react-dom/client'; import { createFromIconfontCN } from '@ant-design/icons'; const MyIcon = createFromIconfontCN({ scriptUrl: '//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js', // 在 iconfont.cn 上生成 }); -ReactDOM.render(, mountedNode); +ReactDOM.createRoot(mountNode).render(); ``` 其本质上是创建了一个使用 `` 标签来渲染图标的组件。 @@ -148,12 +149,14 @@ module.exports = { ``` ```jsx +import React from 'react'; +import ReactDOM from 'react-dom/client'; import Icon from '@ant-design/icons'; -import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file. +import MessageSvg from 'path/to/message.svg'; // 你的 '*.svg' 文件路径 // in create-react-app: // import { ReactComponent as MessageSvg } from 'path/to/message.svg'; -ReactDOM.render(, mountNode); +ReactDOM.createRoot(mountNode).render(); ``` `Icon` 中的 `component` 组件的接受的属性如下: diff --git a/docs/react/i18n.en-US.md b/docs/react/i18n.en-US.md index 578fa1deeb..46c1e340a2 100644 --- a/docs/react/i18n.en-US.md +++ b/docs/react/i18n.en-US.md @@ -102,7 +102,7 @@ See more usage at [ConfigProvider](/components/config-provider). ## Adding new language -If your language is not in above list, feel free to create a locale package based on the [en_US](https://github.com/ant-design/ant-design/blob/master/components/locale/en_US.tsx) language pack and send us a pull request. For reference, you can refer to the pull request of adding the [Azerbaijani](https://github.com/ant-design/ant-design/pull/21387) language as a sample. +If your language is not in above list, feel free to create a locale package based on the [en_US](https://github.com/ant-design/ant-design/blob/master/components/locale/en_US.ts) language pack and send us a pull request. For reference, you can refer to the pull request of adding the [Azerbaijani](https://github.com/ant-design/ant-design/pull/21387) language as a sample. Do it step by step: diff --git a/docs/react/i18n.zh-CN.md b/docs/react/i18n.zh-CN.md index 4c2499ccdf..eb4478ff3a 100644 --- a/docs/react/i18n.zh-CN.md +++ b/docs/react/i18n.zh-CN.md @@ -99,7 +99,7 @@ return ( ## 增加语言包 -如果你找不到你需要的语言包,欢迎你在 [英文语言包](https://github.com/ant-design/ant-design/blob/master/components/locale/en_US.tsx) 的基础上创建一个新的语言包,并给我们发一个 Pull Request,可以参考 [阿塞拜疆语的 PR](https://github.com/ant-design/ant-design/pull/21387)。 +如果你找不到你需要的语言包,欢迎你在 [英文语言包](https://github.com/ant-design/ant-design/blob/master/components/locale/en_US.ts) 的基础上创建一个新的语言包,并给我们发一个 Pull Request,可以参考 [阿塞拜疆语的 PR](https://github.com/ant-design/ant-design/pull/21387)。 基本步骤如下: