Files
shz-admin/src/.umi-production/plugin-antd/runtime.tsx

54 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-11-10 16:28:01 +08:00
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import {
ConfigProvider,
} from 'antd';
import { ApplyPluginsType } from 'umi';
import { getPluginManager } from '../core/plugin';
let cacheAntdConfig = null;
const getAntdConfig = () => {
if(!cacheAntdConfig){
cacheAntdConfig = getPluginManager().applyPlugins({
key: 'antd',
type: ApplyPluginsType.modify,
initialValue: {
},
});
}
return cacheAntdConfig;
}
function AntdProvider({ children }) {
let container = children;
const [antdConfig, _setAntdConfig] = React.useState(() => {
const {
appConfig: _,
...finalConfigProvider
} = getAntdConfig();
return finalConfigProvider
});
const setAntdConfig: typeof _setAntdConfig = (newConfig) => {
_setAntdConfig(prev => {
return merge({}, prev, typeof newConfig === 'function' ? newConfig(prev) : newConfig)
})
}
return container;
}
export function rootContainer(children) {
return (
<AntdProvider>
{children}
</AntdProvider>
);
}