Closed camila-fran-gp closed 1 year ago
https://npmjs.com/airbnb-prop-types has this, so it should be possible. I’d suggest looking at the code.
Specifically, you can’t return oneOf directly - you have to invoke it and return the result. Don’t forget to pass every argument that your custom propType received.
I need to condition a prop of type
oneOf
according to the value of another prop, example:i tried with
isRequiredIf
but it doesn't work :/