-
Notifications
You must be signed in to change notification settings - Fork 894
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
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead #21799
Comments
Hi @EverStarck Thanks for creating the issue. I tested this on multiple sites created using https://playground.wordpress.net/ and https://instawp.com, but I cannot replicate the errors you have pointed out when checking via the Gutenberg editor plugin. Can you please share the exact steps to replicate this, once after reproducing it on the sites created using the above platforms? We look forward to hearing from you and are happy to help you. |
Thanks @josevarghese for your help checking this. I'm also able to reproduce using the latest WP 6.7 RC: https://playground.wordpress.net/?plugin=wordpress-seo&php=8.3&wp=beta You should be able to see the warnings in the javascript console by going to the post editor, for example My guess is that it's related to WordPress now using React 18.3 since version 6.6 as mentioned in this dev note. As referenced there defaultProps is now deprecated and should be replaced with ES6 default params. I see several instances in the Yoast SEO Wordpress plugin code that'll need to be reviewed. |
After a bit more research I found that the warnings I'm noticing in the playground do seem to indeed come from Yoast (they don't show up using https://playground.wordpress.net/?php=8.3&wp=beta) however the one reported by @EverStarck about the We are able to reproduce locally by setting the |
Hi @ibonilla Thanks for the details. Yes, I am now able to replicate the error when the SCRIPT_DEBUG is set as true. However, when I tested with the 6.7-RC3 without setting the |
Hi, I discussed this with our development team, who informed me that they are aware of the |
Please give us a description of what happened
When in the default Gutenberg editor, the console shows lots of
Warning: E: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead
(full error below)These errors don’t show when the Yoast plugin deactivated.
Full error:
I got this from https://wordpress.org/support/topic/yoast-error-on-mobile-view/#post-17985225, but I'm having exactly the same issue. It appears as "resolved" but I think there was a mix of issues, since the fix was for Post Editor: Editor canvas squashed by metabox in mobile/tablet view
Screenshots, screen recording, code snippet
If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.
Technical info
Used versions
The text was updated successfully, but these errors were encountered: