mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
81d8eb8afe
* 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
15 lines
330 B
TypeScript
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;
|
|
}
|
|
};
|