Skip to content

Commit

Permalink
Merge pull request #10 from ice-lab/emptyAssets-before-unmount
Browse files Browse the repository at this point in the history
Empty assets before unmount
  • Loading branch information
daysai committed Aug 20, 2019
2 parents 3305ded + 1782eca commit 8b236df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/stark",
"version": "0.1.2",
"version": "0.1.3",
"description": "Icestark is a JavaScript library for multiple react projects, Ice workbench solution.",
"scripts": {
"build": "rm -rf lib && tsc",
Expand Down Expand Up @@ -39,15 +39,13 @@
"react-dom": ">=15.0.0"
},
"dependencies": {
"history": "^4.6.1",
"path-to-regexp": "^1.7.0",
"url-parse": "^1.1.9"
},
"devDependencies": {
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"@ice/spec": "^0.1.4",
"@types/history": "^4.7.0",
"@types/jest": "^24.0.12",
"@types/node": "^12.0.0",
"@types/path-to-regexp": "^1.7.0",
Expand Down
3 changes: 3 additions & 0 deletions src/AppRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default class AppRoute extends React.Component<AppRouteProps, AppRouteSta
}

componentWillUnmount() {
// Empty useless assets before unmount
const { useShadow } = this.props;
emptyAssets(useShadow);
this.unmounted = true;
setIcestark('root', null);
}
Expand Down

0 comments on commit 8b236df

Please sign in to comment.