facebook/prop-types

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

开放

#388 创建于 2022年10月20日

 (2 条评论) (0 个反应) (0 位负责人)JavaScript (389 个派生)batch import
bughelp wanted

仓库指标

星标
 (4,379 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南