mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
0d67bde239
* 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
16 lines
346 B
TypeScript
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;
|