Last active
August 11, 2023 02:50
-
-
Save CaiJingLong/f60d9ecc3a4852b6c3a22d49719a1298 to your computer and use it in GitHub Desktop.
For umi + antd5 i18n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add dayjs dep first | |
pnpm add dayjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ReactNode } from "react"; | |
import { App, ConfigProvider } from "antd"; | |
import zhCN from "antd/locale/zh_CN"; | |
import "dayjs/locale/zh-cn"; | |
export function rootContainer(container: ReactNode) { | |
return React.createElement(() => { | |
return ( | |
<ConfigProvider locale={zhCN}> | |
<App>{container}</App> | |
</ConfigProvider> | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment