Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Warning: Accessing PropTypes via the main React package is deprecated #163

Closed
alebrozzoSP opened this issue Sep 15, 2017 · 3 comments
Closed

Comments

@alebrozzoSP
Copy link

alebrozzoSP commented Sep 15, 2017

Thanks for this great package, Will! I love React and I love TypeScript, and I love using TypeScript with react!
There are a couple of warnings when building and running the app, which aren't that annoying except that when running tests they clog the console, and also thwy worry me for future use of TS on a React 16 project (that I don't forsee any time soon though 😄)

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

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

Is this a bug report?

Not really, more like a glitch

Which terms did you search for in User Guide?

PropTypes

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected): 2.6.0
  2. node -v: v8.1.0
  3. npm -v: 5.0.3
  4. yarn --version (if you use Yarn): 0.24.6
  5. npm ls react-scripts-ts (if you haven’t ejected): this is # 1 repeated

Then, specify:

  1. Operating system: Win10
  2. Browser and version (if relevant): Any, and console as well

Steps to Reproduce

  1. Just run the app and the warnings appear on the console
    alternatively
  2. yarn test shows the warnings as well (the real reason I created this issue)

Expected Behavior

No warning is displayed

@ianschmitz
Copy link
Contributor

I haven't experienced this. Have you modified the starting template or added any dependencies?

@wmonk
Copy link
Owner

wmonk commented Sep 18, 2017

What is your typescript version. I can only assume that it's compiling to the old createClass functionality of react. Alternatively, are you writing you classes like:

const Comp = createClass({
})

@alebrozzoSP
Copy link
Author

Thanks for both the replies, @ianschmitz & @wmonk! I haven't thought that the problem could be on other dependencies I added myself because I had not seen the warning on the original project structure (I moved from a VS2017 template to separate backend and front end projects). You were correct, one of the warnings was caused by react-datepicker and the other was caused by recharts. I upgraded both and now the warnings are gone.

Thanks again!

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

No branches or pull requests

3 participants