Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.14.6 - Calling PropTypes validators directly is no longer support #584

Closed
1 of 3 tasks
andrewhathaway opened this issue Jun 28, 2017 · 13 comments
Closed
1 of 3 tasks

Comments

@andrewhathaway
Copy link

  • Bug
  • Feature Request
  • Question

Warning: Failed propType: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types Check the render method of `ReactGridLayout`.

I've seen some related issues but nothing updated/fully related to this specific issue. I was wondering if there is any move on fixing this?

Thanks.

@STRML
Copy link
Collaborator

STRML commented Jun 28, 2017

I haven't seen this warning. Can you track it down?

@andrewhathaway
Copy link
Author

Having no luck on narrowing it down to a single cause, but removing propTypes for both ReactGridLayout and GridItem. I fear this may be due to me currently using React 15.0.1.

@tjamet
Copy link

tjamet commented Aug 29, 2017

I have a similar warning:

Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in  React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs
Warning: Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class v15.* is available on npm as a temporary, drop-in replacement. For more info see https://fb.me/react-create-class

it seems to be related to the use of react 15.6.1

package-lock.json (react part):


$> cat package-lock.json | grep -A 5 -e '"react-' -e '"react"'
    "react": {
      "version": "15.6.1",
      "resolved": "https://registry.npmjs.org/react/-/react-15.6.1.tgz",
      "integrity": "sha1-uqhDTsZ4C96ZfNw4C3nNM7ljk98="
    },
    "react-a11y": {
      "version": "0.3.4",
      "resolved": "https://registry.npmjs.org/react-a11y/-/react-a11y-0.3.4.tgz",
      "integrity": "sha1-8x1sFl8JtH/cxpWw8f2uinHxKgU=",
      "dev": true
    },
--
    "react-base16-styling": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/react-base16-styling/-/react-base16-styling-0.5.3.tgz",
      "integrity": "sha1-OFjyTpxN2MvT9wLz901YHKKRcmk=",
      "dev": true
    },
--
    "react-deep-force-update": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/react-deep-force-update/-/react-deep-force-update-1.1.0.tgz",
      "integrity": "sha512-lzBlIeUxdkaZh04pvssVtv3ZSQFUKoEBW4OWx055FieAVUAX4atJhOnSRXkeTpYvaqd1CCg2TJQZbKKifzbafQ==",
      "dev": true
    },
--
    "react-dock": {
      "version": "0.2.4",
      "resolved": "https://registry.npmjs.org/react-dock/-/react-dock-0.2.4.tgz",
      "integrity": "sha1-5yfcdVCztzEWY13LnA4E0Lev4Xw=",
      "dev": true
    },
--
    "react-dom": {
      "version": "15.6.1",
      "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.6.1.tgz",
      "integrity": "sha1-LLDtQZEDjlPCCes6eaI+Kkz5lHA="
    },
    "react-draggable": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/react-draggable/-/react-draggable-3.0.2.tgz",
      "integrity": "sha512-O/y8DyKEpujKSC5ozb5C/iheZenIxYl/pM+1eqOo+9Anc3wcQKmJv7mVLxiASNze2FgCF0qGZoxrnshJhH0IrQ=="
    },
    "react-event-listener": {
      "version": "0.4.5",
      "resolved": "https://registry.npmjs.org/react-event-listener/-/react-event-listener-0.4.5.tgz",
      "integrity": "sha1-4+iVoJcM8U7o+JAROvaBl6vz0LE="
    },
    "react-grid-layout": {
      "version": "0.15.0",
      "resolved": "https://registry.npmjs.org/react-grid-layout/-/react-grid-layout-0.15.0.tgz",
      "integrity": "sha512-rpaY5fz6OqOhkSfnnjK6FvK7JETp+RBVdscav1BaqZKkYnaSsGy23YejlTyxYhPyJP8YAAugSlfm7eO5fZqT+g=="
    },
    "react-helmet": {
      "version": "5.0.3",
      "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.0.3.tgz",
      "integrity": "sha1-xtpj7pboOqfI/m0EHyjdKIsbAG0="
    },
    "react-json-tree": {
      "version": "0.10.9",
      "resolved": "https://registry.npmjs.org/react-json-tree/-/react-json-tree-0.10.9.tgz",
      "integrity": "sha1-cmMXOizIvwXqxjsEGcPOdbIy4oQ=",
      "dev": true
    },
--
    "react-proxy": {
      "version": "1.1.8",
      "resolved": "https://registry.npmjs.org/react-proxy/-/react-proxy-1.1.8.tgz",
      "integrity": "sha1-nb/Z2SdSjDqp9ETkVYw3gwq4wmo=",
      "dev": true
    },
--
    "react-pure-render": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/react-pure-render/-/react-pure-render-1.0.2.tgz",
      "integrity": "sha1-nYqSjH8sN1E8LQZOV7Pjw1bp+rs=",
      "dev": true
    },
--
    "react-redux": {
      "version": "5.0.6",
      "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.6.tgz",
      "integrity": "sha512-8taaaGu+J7PMJQDJrk/xiWEYQmdo3mkXw6wPr3K3LxvXis3Fymiq7c13S+Tpls/AyNUAsoONkU81AP0RA6y6Vw=="
    },
    "react-resizable": {
      "version": "1.7.2",
      "resolved": "https://registry.npmjs.org/react-resizable/-/react-resizable-1.7.2.tgz",
      "integrity": "sha512-ebY7w+aj9IJGMX+q+OG1mlgDfpN7MIqElBxwUhBMhKrcVM02tduCr02zfl16RmSNdsq3OF7PKBnMrR1MPX4+/w=="
    },
    "react-router": {
      "version": "3.0.5",
      "resolved": "https://registry.npmjs.org/react-router/-/react-router-3.0.5.tgz",
      "integrity": "sha1-w7eHN1gEWou8lWKu9P9LyMznwTY=",
      "dependencies": {
        "hoist-non-react-statics": {
--
    "react-router-redial": {
      "version": "0.3.5",
      "resolved": "https://registry.npmjs.org/react-router-redial/-/react-router-redial-0.3.5.tgz",
      "integrity": "sha1-emxjK1BSDT82pz7Zv7IrbrAuz0Y="
    },
    "react-router-redux": {
      "version": "4.0.8",
      "resolved": "https://registry.npmjs.org/react-router-redux/-/react-router-redux-4.0.8.tgz",
      "integrity": "sha1-InQDWWtRUeGCN32rg1tdRfD4BU4="
    },
    "react-router-scroll-async": {
      "version": "0.5.1",
      "resolved": "https://registry.npmjs.org/react-router-scroll-async/-/react-router-scroll-async-0.5.1.tgz",
      "integrity": "sha1-KddJY7Ka5CR13gDalRNId2P2DaY="
    },
    "react-server-status": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/react-server-status/-/react-server-status-1.1.0.tgz",
      "integrity": "sha1-Um23xCoBGVvE0q8+p209phNscfo="
    },
    "react-side-effect": {
      "version": "1.1.3",
      "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-1.1.3.tgz",
      "integrity": "sha1-USwlq+DewXKDTEAB7FxR4E1BvFw="
    },
    "react-transform-catch-errors": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/react-transform-catch-errors/-/react-transform-catch-errors-1.0.2.tgz",
      "integrity": "sha1-G01KdulycYlvwW/jCGx5PsiKnus=",
      "dev": true
    },
--
    "react-transform-hmr": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz",
      "integrity": "sha1-4aQL0Krvxy6N/Xp82gmvhQZjl7s=",
      "dev": true
    },
--
    "react-transition-group": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-1.2.0.tgz",
      "integrity": "sha1-tR/JIbDDg1p+98Vxx5/ILHPpIE8="
    },
    "read-all-stream": {

@madisonbullard
Copy link

I just installed react-grid-library and am now getting the same warnings as @tjamet with React 15.6.1

@larpo
Copy link

larpo commented Sep 5, 2017

Started to see these again with 0.15... seems like all of the
import * as React from 'react';
get transpiled into _interopRequireWildcard(_react); which in turns imports also the deprecated functions from react lib, and triggers these warnings even though the deprecated functions are not actually used.

@STRML
Copy link
Collaborator

STRML commented Sep 5, 2017

Update your dependencies; react-resizable and react-draggable have been updated to eliminate this.

@larpo
Copy link

larpo commented Sep 5, 2017

I don't think this has anything to do with react-resizable or react-draggable.
React throws the warning if the deprecated functions are accessed:

Object.defineProperty(React, 'PropTypes', {
      get: function () {
        lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in  React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
        didWarnPropTypesDeprecated = true;
        return ReactPropTypes;
      }
    });

    Object.defineProperty(React, 'createClass', {
      get: function () {
        lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
        warnedForCreateClass = true;
        return createReactClass;
      }
    });

The transpiled * import iterates over the module and causes the getter to be triggered:

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

(And yes, I did a fresh install with updated deps. Didn't help.)

@STRML
Copy link
Collaborator

STRML commented Sep 5, 2017

Ah yes, and we are still doing import *. Will fix.

@STRML STRML closed this as completed in dc8fbb5 Sep 5, 2017
@STRML
Copy link
Collaborator

STRML commented Sep 5, 2017

0.15.1

@larpo
Copy link

larpo commented Sep 5, 2017

Unfortunately, seems like there are still some import *'s left

https://github.com/STRML/react-grid-layout/search?l=JSX&q=import+%2A+as+React+from+%27react%27&type=&utf8=✓

@STRML
Copy link
Collaborator

STRML commented Sep 5, 2017 via email

@niksosf
Copy link

niksosf commented Oct 7, 2017

HI STRML, (great lib, btw)

Thanks for the effort put in in extinguishing this warning, unfortunately at 0.16.0 with yarn updating all dependencies , there is still shown the prop types being access by GridItem.js component, is this the case on your end ?
image

@STRML
Copy link
Collaborator

STRML commented Oct 7, 2017

Unfortunately this happens when doing import * from React, it has nothing to do with actually using PropTypes (we aren't).

See facebook/react#10583

This warning goes away in React 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants