From f47755a1628e7d7d0563f55d2090cbebc97a6f52 Mon Sep 17 00:00:00 2001 From: ycjcl868 <45808948@qq.com> Date: Sat, 2 Mar 2019 22:55:02 +0800 Subject: [PATCH] fix: doc --- content/docs/typechecking-with-proptypes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/typechecking-with-proptypes.md b/content/docs/typechecking-with-proptypes.md index 9a74194e2a..70fa1f433c 100644 --- a/content/docs/typechecking-with-proptypes.md +++ b/content/docs/typechecking-with-proptypes.md @@ -91,8 +91,8 @@ MyComponent.propTypes = { // 任意类型的数据 requiredAny: PropTypes.any.isRequired, - // 你可以指定一个自定义验证器。如果验证失败应该返回一个 Error 对象 - // 而不是 `console.warn` 或抛异常,因为在 `onOfType` 中不会起作用。 + // 你可以指定一个自定义验证器。它在验证失败时应返回一个 Error 对象。 + // 请不要使用 `console.warn` 或抛出异常,因为这在 `onOfType` 中不会起作用。 customProp: function(props, propName, componentName) { if (!/matchme/.test(props[propName])) { return new Error(