facebook/prop-types

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

Open

#388 aberto em 20 de out. de 2022

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (389 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (4.379 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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].

Guia do colaborador