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

[Tech debt] Remove defaultProps from function components #7297

Merged
merged 4 commits into from
Oct 19, 2023

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Oct 18, 2023

Summary

See #7287 (NOTE: Does not close the issue fully - we need #7296 for that as well)

React 18 is deprecating support for defaultProps - this PR removes all instances of function component defaultProps, and also checks that all props tables in our docs work as expected.

QA

General checklist

  • Browser QA - N/A
  • Docs site QA
    • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • Code quality checklist - N/A, current tests passing should suffice
  • Release checklist - N/A, this should not have any consumer or user facing impact
  • Designer checklist - N/A

- remove totally unused prop
- convert other to `= {}` fallback
…tion

- a few hard-coded props (that were present in the table) should have been defined in the destructure fallbacks, so that their defaults display in our docs prop table
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@cee-chen cee-chen marked this pull request as ready for review October 18, 2023 23:45
@cee-chen cee-chen requested a review from a team as a code owner October 18, 2023 23:45

AppContext.propTypes = {
children: PropTypes.any,
currentRoute: PropTypes.object.isRequired,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we lose this or is it just no longer neccessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary - it wasn't even being used, so my guess was it was a bad copy/paste job

@cee-chen
Copy link
Member Author

Thanks for the review Jason! ❤️

@cee-chen cee-chen merged commit de10c65 into elastic:main Oct 19, 2023
12 of 13 checks passed
@cee-chen cee-chen deleted the default-props branch October 19, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants