-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stop using componentWillMount #644
Labels
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This was referenced Aug 30, 2018
made PR #830 to fix this |
As I mentioned in #830, this is going to be fixed in emotion 10. |
Closing as fixed by Emotion 10 |
facebook-github-bot
pushed a commit
to facebook/flipper
that referenced
this issue
Dec 11, 2019
Summary: React 16 is not compatible with react-emotion 9 (it prints warnings, see also emotion-js/emotion#644). So we should upgrade to 10. Reviewed By: mweststrate Differential Revision: D18905889 fbshipit-source-id: c00d2dbbadb1c08544632cb9bfcd63f2b1818a25
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
emotion
version: 9.1.3react
version: 16.3Relevant code.
What you did:
Update to React 16.3 and use
strict mode
.What happened:
This warning appeared:
componentWillMount: Please update the following components to use componentDidMount instead: Styled(div), Styled(li), Styled(span), Styled(ul)
Reproduction:
Just use
styled
within Reactstrict-mode
or ReactAsync
:https://codesandbox.io/s/732mw5w53j
Problem description:
componentWillMount
is going to be deprecated and should be avoided from now on.Suggested solution:
This is the
componentWillMount
which is causing the warning:https://github.com/emotion-js/emotion/blob/82fd71a8f9fda7df31b4810b17a255a75500686b/packages/create-emotion-styled/src/index.js
That logic could be moved to the
componentDidMount
or theconstructor
. Whichever is the case, let me know and I'll do a PR.The text was updated successfully, but these errors were encountered: