From e2b6054cc479dae87e619dd0f2b7d93993f687ec Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 15 Nov 2016 15:18:40 +0800 Subject: [PATCH] style: update code style --- components/input/Group.tsx | 4 ---- components/input/Input.tsx | 11 +++-------- components/tree/demo/search.md | 16 ++++++++-------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/components/input/Group.tsx b/components/input/Group.tsx index 63e66ece75..9b9ce64db0 100644 --- a/components/input/Group.tsx +++ b/components/input/Group.tsx @@ -24,8 +24,4 @@ const Group: React.StatelessComponent = (props) => { ); }; -Group.propTypes = { - children: React.PropTypes.any, -}; - export default Group; diff --git a/components/input/Input.tsx b/components/input/Input.tsx index da073f3462..d178a1f164 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -85,16 +85,12 @@ export default class Input extends Component { nextFrameActionId: number; refs: { - [key: string]: any; input: any; }; - constructor(props) { - super(props); - this.state = { - textareaStyles: null, - }; - } + state = { + textareaStyles: null, + }; componentDidMount() { this.resizeTextarea(); @@ -173,7 +169,6 @@ export default class Input extends Component { renderInput() { const props = assign({}, this.props); - // Fix https://fb.me/react-unknown-prop const otherProps = omit(this.props, [ 'prefixCls', diff --git a/components/tree/demo/search.md b/components/tree/demo/search.md index 659e644cb9..80b147df08 100644 --- a/components/tree/demo/search.md +++ b/components/tree/demo/search.md @@ -111,13 +111,13 @@ class SearchTree extends React.Component { const index = item.key.search(searchValue); const beforeStr = item.key.substr(0, index); const afterStr = item.key.substr(index + searchValue.length); - const title = index > -1 ? - - {beforeStr} - {searchValue} - {afterStr} - - : {item.key}; + const title = index > -1 ? ( + + {beforeStr} + {searchValue} + {afterStr} + + ) : {item.key}; if (item.children) { return ( @@ -153,4 +153,4 @@ ReactDOM.render(, mountNode); color: #f50; transition: all .3s ease; } -```` \ No newline at end of file +````