How to use the warning.default 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 cristiandley / react-gl-maps / src / creators / GoogleMapHolder.js View on Github external
static _createMap(domEl, mapProps) {
    warning(`undefined` !== typeof google,
`Make sure you've put a 
github tomchentw / react-google-maps / src / lib / async / ScriptjsLoader.js View on Github external
componentWillMount() {
    warning(this.shouldUseNewBehavior(),
`"async/ScriptjsLoader" is now rendering "GoogleMapLoader".
Migrate to use "GoogleMapLoader" instead.
The old behavior will be removed in next major release (5.0.0).
See https://github.com/tomchentw/react-google-maps/pull/157 for more details.`
    );
    if (!canUseDOM) {
      return;
    }
    /*
     * External commonjs require dependency -- begin
     */
    const scriptjs = require(`scriptjs`); // eslint-disable-line global-require
    /*
     * External commonjs require dependency -- end
     */
    const { protocol, hostname, port, pathname, query } = this.props;
github tomchentw / react-google-maps / src / lib / creators / GoogleMapHolder.js View on Github external
static _createMap(domEl, mapProps) {
    warning(`undefined` !== typeof google,
`Make sure you've put a 
github tomchentw / react-google-maps / src / lib / async / ScriptjsLoader.js View on Github external
componentWillReceiveProps(nextProps) {
    if (`production` !== process.env.NODE_ENV) {
      const changedKeys = getUrlObjChangedKeys(this.props, nextProps);

      warning(
        changedKeys.length === 0,
`ScriptjsLoader doesn't support mutating url related props after initial render.
Changed props: %s`,
`[${changedKeys.join(`, `)}]`
      );
    }
  }
github tomchentw / react-google-maps / src / async / ScriptjsGoogleMap.js View on Github external
componentWillMount() {
    warning(false,
`"async/ScriptjsGoogleMap" is deprecated now and will be removed in next major release (5.0.0). Use "async/ScriptjsLoader" instead.
See https://github.com/tomchentw/react-google-maps/pull/150 for more details.`
    );
  }

warning

A mirror of Facebook's Warning

MIT
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis