How to use the warning.apply function in warning

To help you get started, we’ve selected a few warning examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / react / packages / shared / forks / consoleWithStackDev.www.js View on Github external
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
      // Defensive in case this is fired before React is initialized.
      if (ReactSharedInternals != null) {
        const ReactDebugCurrentFrame =
          ReactSharedInternals.ReactDebugCurrentFrame;
        const stack = ReactDebugCurrentFrame.getStackAddendum();
        if (stack !== '') {
          format += '%s';
          args.push(stack);
        }
      }
    }
    // TODO: don't ignore level and pass it down somewhere too.
    args.unshift(format);
    args.unshift(false);
    warningWWW.apply(null, args);
  }
}
github mendersoftware / gui / node_modules / react-router / es6 / routerWarning.js View on Github external
// Only issue deprecation warnings once.
  if (message.indexOf('deprecated') !== -1) {
    if (warned[message]) {
      return;
    }

    warned[message] = true;
  }

  message = '[react-router] ' + message;

  for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }

  warning.apply(undefined, [falseToWarn, message].concat(args));
}

warning

A mirror of Facebook's Warning

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis