如果我将正则表达式作为 prop 传递(例如:
typeRegex={/Photographer/gi}
PropTypes.instanceOf(RegExp)
这对我有用
PropTypes.shape(RegExp)