warning.js 522 B

123456789101112131415
  1. import vcWarning, { resetWarned } from '../vc-util/warning';
  2. export { resetWarned };
  3. export function noop() {}
  4. // eslint-disable-next-line import/no-mutable-exports
  5. let warning = noop;
  6. if (process.env.NODE_ENV !== 'production') {
  7. warning = (valid, component, message) => {
  8. vcWarning(valid, `[ant-design-vue: ${component}] ${message}`);
  9. // StrictMode will inject console which will not throw warning in React 17.
  10. if (process.env.NODE_ENV === 'test') {
  11. resetWarned();
  12. }
  13. };
  14. }
  15. export default warning;