ant-design/components/_util/warning.tsx

10 lines
281 B
TypeScript
Raw Normal View History

2019-01-12 22:19:38 +08:00
import warning from 'warning';
2019-01-12 19:22:06 +08:00
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;
}
};