ant-design/components/_util/warning.tsx
zombieJ 4d1a998246
add component param in warning (#15078)
* add component param in warning

* update snapshot
2019-02-27 15:32:29 +08:00

10 lines
281 B
TypeScript

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