packages/fbjs/src/__forks__/warning.js
function printWarning(format, ...args) {
  var argIndex = 0;
  var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
  if (typeof console !== 'undefined') {
    console.error(message);
  }
  try {
    // --- Welcome to debugging React ---
    // This error was thrown as a convenience so that you can use this stack
    // to find the callsite that caused this warning to fire.
    throw new Error(message);
  } catch (x) {}
}
function printWarning(format, ...args) {
  var argIndex = 0;
  var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
  if (typeof console !== 'undefined') {
    console.error(message);
  }
  try {
    // --- Welcome to debugging React ---
    // This error was thrown as a convenience so that you can use this stack
    // to find the callsite that caused this warning to fire.
    throw new Error(message);
  } catch (x) {}
}
function printWarning ( format , ... args ) { var argIndex = 0 ; var message = 'Warning: ' + format . replace ( / %s / g , ( ) => args [ argIndex ++ ] ) ; if ( typeof console !== 'undefined' ) { console . error ( message ) ; } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error ( message ) ; } catch ( x ) { } }
Similar to invariant but only logs a warning if the condition is not met.
This can be used to log issues in development environments in critical
paths. Removing the logging code for production environments will keep the
same logic and follow the same code paths.
Similar to invariant but only logs a warning if the condition is not met . This can be used to log issues in development environments in critical paths . Removing the logging code for production environments will keep the same logic and follow the same code paths .