Skip to content

Commit

Permalink
fix: component should update
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed Sep 6, 2017
1 parent d59b28d commit 70172b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rmc-dialog",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"description": "mobile dialog ui component for react",
"keywords": [
"react",
Expand Down
4 changes: 4 additions & 0 deletions src/DialogWrap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export default class DialogWrap extends React.Component<IDialogPropTypes, any> {
}
}

shouldComponentUpdate({ visible }) {
return !!(this.props.visible || visible);
}

componentWillUnmount() {
this.renderDialog(false);
}
Expand Down

0 comments on commit 70172b8

Please sign in to comment.