Closed mikecousins closed 5 years ago
Please have a look at the next release:
npm install react-media@next
1.10.0-alpha.1 works for me. Before, I was getting the following in the console:
react-dom.development.js:12050 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
- Move code with side effects to componentDidMount, and set initial state in the constructor.
- Rename componentWillMount to UNSAFEcomponentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE name will work. To rename all deprecated lifecycles to their new names, you can run
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: Media
Now the message is gone. Thanks @edorivai.
@edorivai Hi,
So same as everyone else, why is this release an alpha any issues with the current lib?
Hi :wave:,
Reason it's an behind the @next
flag is because I wanted to make sure some people tested this out in the wild before publishing a minor version bump. Since it's a minor bump, depending on the setup people have they might auto upgrade to this version without realizing. This should be fine, it's a minor upgrade, so it should be backwards compatible, but I wanted to make sure before publishing.
I guess by now enough people have tested it (judging from the :+1:'s in this thread), I'll try to publish this on mainline soon.
Allright, thanks for your time!
v1.10.0 has been deployed as latest
npm install react-media
should now install that version which should take care of any react deprecation warnings :tada:
componentWillMount is deprecated with warnings now in 16.9.
Here is the warning that is emitted: react-dom.development.js:12050 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: Media