偏右
5 years ago
committed by
GitHub
22 changed files with 246 additions and 74 deletions
@ -0,0 +1,7 @@ |
|||
import warning, { resetWarned } from 'rc-util/lib/warning'; |
|||
|
|||
export { resetWarned }; |
|||
|
|||
export default (valid: boolean, component: string, message: string): void => { |
|||
warning(valid, `[antd: ${component}] ${message}`); |
|||
}; |
@ -1,14 +0,0 @@ |
|||
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; |
|||
} |
|||
}; |
Loading…
Reference in new issue