feat: feat: expose ConfigContext (#26705)

This commit is contained in:
paranoidjk 2020-09-11 21:24:26 +08:00 committed by GitHub
parent 5507641331
commit ea19589619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,9 @@ export interface ConfigProviderProps {
dropdownMatchSelectWidth?: boolean;
}
const ConfigProvider: React.FC<ConfigProviderProps> = props => {
const ConfigProvider: React.FC<ConfigProviderProps> & {
ConfigContext: typeof ConfigContext;
} = props => {
React.useEffect(() => {
if (props.direction) {
message.config({
@ -166,4 +168,6 @@ const ConfigProvider: React.FC<ConfigProviderProps> = props => {
);
};
/** @private internal usage. do not use in your production */
ConfigProvider.ConfigContext = ConfigContext;
export default ConfigProvider;