facebook/prop-types

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

Open

#388 建立於 2022年10月20日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)JavaScript (4,379 star) (389 fork)batch import
bughelp wanted

描述

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

貢獻者指南

`oneOfType()` does not seem to allow all types specified · facebook/prop-types#388 | Good First Issue