Skip to content

Commit

Permalink
site: add shouldComponentUpdate form Demo.jsx, close: ant-design#3090
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Sep 20, 2016
1 parent 9b99c38 commit e9d6590
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions site/theme/template/Content/Demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export default class Demo extends React.Component {
};
}

shouldComponentUpdate(nextProps, nextState) {
return (this.state.codeExpand || this.props.expand) !== (nextState.codeExpand || nextProps.expand);
}

handleCodeExapnd = () => {
this.setState({ codeExpand: !this.state.codeExpand });
}
Expand Down

0 comments on commit e9d6590

Please sign in to comment.