-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
@evcohen You did a great job with this! It's too bad that prop-types is in maintenance mode now and won't merge this in.
The company I work for went ahead and created a fork that adds isRequiredIf functionality. It takes a function and gets passed the props, like:
id: PropTypes.number.isRequiredIf( props => !props.uid )It doesn't take a boolean like yours does because we didn't require that.
Anyway, just wanted to say thanks for your efforts and if anybody is still stuck using prop-types and wants to use a natural syntax for conditional requirements, feel free to use it. It can be found here:
https://github.com/cntral/prop-types/tree/isRequiredIf
And you can easily use it in your package.json like so:
"prop-types": "github:cntral/prop-types#isRequiredIf"🍻
beefancohen
Metadata
Metadata
Assignees
Labels
No labels