Skip to content

Commit e2c50d5

Browse files
committed
feat: 添加antd相关的配置文件
1 parent 4744640 commit e2c50d5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/features/antdConfig/AntdContextHolder.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { App } from 'antd';
2+
import type { PropsWithChildren } from 'react';
23

4+
import '@ant-design/v5-patch-for-react-19';
35
import { cacheTabs } from '@/store/slice/tab';
46
import { cacheThemeSettings } from '@/store/slice/theme';
57

@@ -11,7 +13,7 @@ function ContextHolder() {
1113
return null;
1214
}
1315

14-
const AppProvider = memo(({ children }: { children: React.ReactNode }) => {
16+
const AppProvider = ({ children }: PropsWithChildren) => {
1517
const dispatch = useAppDispatch();
1618

1719
useEventListener(
@@ -29,6 +31,6 @@ const AppProvider = memo(({ children }: { children: React.ReactNode }) => {
2931
{children}
3032
</App>
3133
);
32-
});
34+
};
3335

3436
export default AppProvider;

src/features/antdConfig/AntdProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { WatermarkProps } from 'antd';
2-
import React from 'react';
2+
import type { PropsWithChildren } from 'react';
33

44
import { info } from '@/constants/app';
55
import { antdLocales } from '@/locales/antd';
@@ -40,7 +40,7 @@ function useAntdTheme() {
4040
return { antdTheme, watermarkText: themeSettings.watermark.text, watermarkVisible: themeSettings.watermark.visible };
4141
}
4242

43-
function AntdConfig({ children }: { readonly children: React.ReactNode }) {
43+
function AntdConfig({ children }: PropsWithChildren) {
4444
const { locale } = useLang();
4545

4646
const { antdTheme, watermarkText, watermarkVisible } = useAntdTheme();

0 commit comments

Comments
 (0)