ant-design/components/_util/warning.tsx
zombieJ 81d8eb8afe
feat: ConfigProvider support locale (#17816)
* ConfigProvider support locale

* update docs

* update category

* clean up

* moving locale

* update check script

* update related code

* add test case

* demo link

* update doc

* hide one rule of md with eslint

* update error link
2019-07-24 10:34:55 +08:00

15 lines
330 B
TypeScript

import warning from 'warning';
let warned: Record<string, boolean> = {};
export function resetWarned() {
warned = {};
}
export default (valid: boolean, component: string, message: string): void => {
if (!valid && !warned[message]) {
warning(false, `[antd: ${component}] ${message}`);
warned[message] = true;
}
};