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

Improve propTypes validation #156

Closed
adamkudrna opened this issue Sep 29, 2020 · 1 comment
Closed

Improve propTypes validation #156

adamkudrna opened this issue Sep 29, 2020 · 1 comment

Comments

@adamkudrna
Copy link
Member

adamkudrna commented Sep 29, 2020

We would like to validate that:

  • mutually exclusive props aren't set at the same time
  • parent component of a multi-level component only receives children of certain type (eg. Toolbar only accepts ToolbarItem and ToolbarGroup and nothing else)
  • component passed in props where a given type is required (i.e. ScrollView prop in the Modal component)

Make use of https://github.com/airbnb/prop-types ?

Relates to facebook/prop-types#327 (comment)

@bedrich-schindler
Copy link
Contributor

We are closing this issue. We've decided that we will not try to validate children as we do not know whether library user will not want to use wrapped version of supported elements which is a thing we are not able to validate in simple way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment