facebook/prop-types

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

オープン

#388 opened on 2022/10/20

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (389 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (4,379 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド