From 8d817e6eee71cf8e452028dd2ffe9208674cb53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=B2=E8=80=98=E2=84=A2?= Date: Tue, 15 Mar 2016 18:17:49 +0800 Subject: [PATCH] update(propTypes): more restrictions on propTypes --- components/button/button-group.jsx | 2 +- components/button/button.jsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/button/button-group.jsx b/components/button/button-group.jsx index 46829114f3..e166885054 100644 --- a/components/button/button-group.jsx +++ b/components/button/button-group.jsx @@ -24,5 +24,5 @@ export default class ButtonGroup extends React.Component { } } ButtonGroup.propTypes = { - size: React.PropTypes.string, + size: React.PropTypes.oneOf(['large', 'small']), }; diff --git a/components/button/button.jsx b/components/button/button.jsx index e6db04ff64..73e82e2f3e 100644 --- a/components/button/button.jsx +++ b/components/button/button.jsx @@ -73,10 +73,10 @@ export default class Button extends React.Component { } Button.propTypes = { - type: React.PropTypes.string, - shape: React.PropTypes.string, - size: React.PropTypes.string, - htmlType: React.PropTypes.string, + type: React.PropTypes.oneOf(['primary', 'ghost', 'dashed']), + shape: React.PropTypes.oneOf(['circle', 'circle-outline']), + size: React.PropTypes.oneOf(['large', 'small']), + htmlType: React.PropTypes.oneOf(['submit', 'button', 'reset']), onClick: React.PropTypes.func, loading: React.PropTypes.bool, className: React.PropTypes.string,