ant-design/components/_util/warning.tsx

10 lines
238 B
TypeScript
Raw Normal View History

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