ant-design/components/config-provider/hooks/useConfig.ts
xliez 0d67bde239
feat: add useConfig hook to ConfigProvider (#40215)
* feat: add useConfig hook to ConfigProvider

* docs: format config-provide markdown

* doc: add available version

* test: add useConfig test

* docs: add debug

* chore: fix lint error

* fix: getter dead loop

* test: promote useConfig test coverage

* docs(ConfigProvider): update available version
2023-02-14 17:39:35 +08:00

16 lines
346 B
TypeScript

import { useContext } from 'react';
import DisabledContext from '../DisabledContext';
import SizeContext from '../SizeContext';
function useConfig() {
const componentDisabled = useContext(DisabledContext);
const componentSize = useContext(SizeContext);
return {
componentDisabled,
componentSize,
};
}
export default useConfig;