first commit
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
53
src/.umi-production/plugin-antd/runtime.tsx
Normal file
53
src/.umi-production/plugin-antd/runtime.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
// @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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user