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

React 19: any custom prop type validation needs to be refactored #6553

Closed
9 of 17 tasks
matthewgallo opened this issue Dec 6, 2024 · 0 comments · May be fixed by #6552
Closed
9 of 17 tasks

React 19: any custom prop type validation needs to be refactored #6553

matthewgallo opened this issue Dec 6, 2024 · 0 comments · May be fixed by #6552
Assignees
Labels

Comments

@matthewgallo
Copy link
Member

matthewgallo commented Dec 6, 2024

We have prop type utilities, such as PropTypes.string.isRequired.if(() => ....),, to handle a certain prop being conditionally required. With the removal of prop-types support in React 19, these utilities need to be refactored to handle the validation differently.

  • UserAvatar
  • UserProfileImage
  • APIKeyDownloader
  • GuideBanner
  • isRequiredIf
  • deprecateProp
  • deprecatePropUsage
  • AboutModal
  • CreateModal
  • EditTearsheet
  • EmptyState
  • ActionSet
  • Datagrid
  • TearsheetNarrow
  • Tearsheet
  • SidePanel
  • PageHeader

Thinking more about this, I'm starting to feel that we don't need to migrate all of these components to use custom prop validation. React 19 leans on the fact that TypeScript is now the way to enforce type checking, I think we should as well. This means that we remove any tests expecting console errors from the custom validations we've added in the past since anything prop-type related is now silently ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done 🚀
Development

Successfully merging a pull request may close this issue.

1 participant