facebook/prop-types

`oneOfType()` does not seem to allow all types specified

Open

#388 aperta il 20 ott 2022

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (389 fork)batch import
bughelp wanted

Metriche repository

Star
 (4379 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I am running into an issue where oneOfType() is passed in types of shape and string but is only allowing string seemingly.

Reproduced here (using a simplified version of types I have encountered on a project I am working on), https://jsfiddle.net/liamness/1du5jvwt/, with the warning:

Failed prop type: Invalid prop `schema[1]` supplied to `ComponentName`, expected one of type [string].

Guida contributor