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

YellowBox Warning: componentWillReceiveProps is deprecated #1242

Closed
maxme opened this issue Jul 23, 2019 · 6 comments
Closed

YellowBox Warning: componentWillReceiveProps is deprecated #1242

maxme opened this issue Jul 23, 2019 · 6 comments
Labels
dependencies Pull requests that update a dependency file [Type] Bug Something isn't working

Comments

@maxme
Copy link
Contributor

maxme commented Jul 23, 2019

There is currently a warning showing on the gutenberg mobile demo app:

Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.

Screenshot_1563871613

It's due to at least one of our dependencies:

Screenshot_1563874106

I couldn't find any occurrences of componentWillReceiveProps in our code, so I think updating the dependencies would be enough to fix this.

@maxme maxme added [Type] Bug Something isn't working dependencies Pull requests that update a dependency file labels Jul 23, 2019
@maxme maxme self-assigned this Jul 23, 2019
@maxme
Copy link
Contributor Author

maxme commented Jul 23, 2019

I tried to upgrade react-native-modal to latest version (v11.1.0). Doing this removes the warning, but there is another warning when the bottom sheet animation starts:

Screenshot_1563875473

This one comes from a react-native-modal dependency: react-native-animatable and is not fixed yet:

oblador/react-native-animatable#180 (comment)

@maxme maxme removed their assignment Jul 23, 2019
@maxme
Copy link
Contributor Author

maxme commented Jul 26, 2019

In the meantime, one can hide this warning by adding it to the ignore list in src/index.js:

diff --git a/src/index.js b/src/index.js
index b0554c0f..684d0bc3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -77,7 +77,7 @@ export class RootComponent extends React.Component {

 export function registerApp() {
        // Disable require circle warnings showing up in the app (they will still be visible in the console)
-       YellowBox.ignoreWarnings( [ 'Require cycle:' ] );
+       YellowBox.ignoreWarnings( [ 'Require cycle:', 'componentWillReceiveProps'] );

@hypest
Copy link
Contributor

hypest commented Jun 11, 2020

Not seeing the YellowBox anymore, at least on 7495fbf. Closing but let's reopen if it comes back.

@hypest hypest closed this as completed Jun 11, 2020
@mchowning
Copy link
Contributor

mchowning commented Jun 11, 2020

I just commented out this line:

console.disableYellowBox = true;

and loaded the editor to this 😱

all_the_warnings mp4

I'm thinking maybe we should keep this one open 🙂 (there are some componentWillReceiveProps deprecation warnings in there), and probably add new issues for the other warnings too. WDYT @hypest ?

If we ignore the "Require cycle" warnings specifically, it looks like the number of remaining YellowBox warnings would be much more manageable, although I think there will still be enough that it will be very annoying to deal with.

@hypest
Copy link
Contributor

hypest commented Jun 12, 2020

Yes, let's re-open.

Also, wondering if the 0.62.x upgrade has the same issues reported.

@hypest hypest reopened this Jun 12, 2020
@geriux
Copy link
Contributor

geriux commented May 14, 2024

Closing since there are no componentWillReceiveProps references anymore.

@geriux geriux closed this as completed May 14, 2024
@github-project-automation github-project-automation bot moved this to Done (keep clean, manually) in Mobile Gutenberg Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file [Type] Bug Something isn't working
Projects
Status: Done (keep clean, manually)
Development

No branches or pull requests

4 participants