parent
94c2887c81
commit
0399ce0ec7
@ -1,7 +0,0 @@
|
||||
import warning, { resetWarned } from '../vc-util/warning';
|
||||
|
||||
export { resetWarned };
|
||||
|
||||
export default (valid, component, message = '') => {
|
||||
warning(valid, `[antdv: ${component}] ${message}`);
|
||||
};
|
@ -0,0 +1,21 @@
|
||||
import vcWarning, { resetWarned } from '../vc-util/warning';
|
||||
|
||||
export { resetWarned };
|
||||
export function noop() {}
|
||||
|
||||
type Warning = (valid: boolean, component: string, message?: string) => void;
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
let warning: Warning = noop;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warning = (valid, component, message) => {
|
||||
vcWarning(valid, `[antd: ${component}] ${message}`);
|
||||
|
||||
// StrictMode will inject console which will not throw warning in React 17.
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
resetWarned();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default warning;
|
Loading…
Reference in new issue