Skip to content

Allow descriptions for oneOfType values #301

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

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

cangoektas
Copy link
Contributor

@cangoektas cangoektas commented Oct 8, 2018

Hey!

Hope you don't mind me putting this PR together without a clear consent for this feature. I just had a lot of fun diving into this 😄

Changes

Allows items of oneOfType to have descriptions as well, similar to properties of shape. Fixes #300.

Example

{
  foo: PropTypes.shape({
    /** This was possible previously */
    a: PropTypes.string
  }),
  bar: PropTypes.oneOfType([
    /** Now this is possible, too */
    PropTypes.string,
    PropTypes.number
  ])
}

@danez
Copy link
Collaborator

danez commented Oct 24, 2018

Thank you very much for this. This looks great. Feel free to create more PRs :)

@danez danez merged commit 69bf008 into reactjs:master Oct 24, 2018
@cangoektas cangoektas deleted the one-of-type-descriptions branch October 24, 2018 09:38
@cangoektas
Copy link
Contributor Author

@danez nice, thanks a lot! Is there also a chance to get this released soon? 😄

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants