Skip to content

Instantly share code, notes, and snippets.

@CaiJingLong
Last active August 11, 2023 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CaiJingLong/f60d9ecc3a4852b6c3a22d49719a1298 to your computer and use it in GitHub Desktop.
Save CaiJingLong/f60d9ecc3a4852b6c3a22d49719a1298 to your computer and use it in GitHub Desktop.
For umi + antd5 i18n
# Add dayjs dep first
pnpm add dayjs
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