Skip to content

Commit f47755a

Browse files
committed
fix: doc
1 parent 80adf62 commit f47755a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/typechecking-with-proptypes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ MyComponent.propTypes = {
9191
// 任意类型的数据
9292
requiredAny: PropTypes.any.isRequired,
9393

94-
// 你可以指定一个自定义验证器。如果验证失败应该返回一个 Error 对象
95-
// 而不是 `console.warn` 或抛异常,因为在 `onOfType` 中不会起作用。
94+
// 你可以指定一个自定义验证器。它在验证失败时应返回一个 Error 对象
95+
// 请不要使用 `console.warn` 或抛出异常,因为这在 `onOfType` 中不会起作用。
9696
customProp: function(props, propName, componentName) {
9797
if (!/matchme/.test(props[propName])) {
9898
return new Error(

0 commit comments

Comments
 (0)