mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 15:59:38 +08:00
4d1a998246
* add component param in warning * update snapshot
10 lines
281 B
TypeScript
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;
|
|
}
|
|
};
|