Skip to content

Commit

Permalink
fix: 🐛 add missing props for lifecycles (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
maoxiaoke authored Dec 3, 2021
1 parent 2a0dd5d commit 84dead4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/icestark-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.4.3

- [fix] add missing props for `registerAppEnter` & `registerAppLeave`.

## 1.4.2

- [fix] Bind history to window when using `AppLink`. ([#428](https://github.com/ice-lab/icestark/pull/428))
Expand Down
2 changes: 1 addition & 1 deletion packages/icestark-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/stark-app",
"version": "1.4.2",
"version": "1.4.3",
"description": "icestark-app is a JavaScript library for icestark, used by sub-application.",
"scripts": {
"build": "rm -rf lib && tsc",
Expand Down
2 changes: 2 additions & 0 deletions packages/icestark-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ export { default as appHistory } from './appHistory';
export { default as isInIcestark } from './isInIcestark';
export { default as AppLink } from './AppLink';
export { default as setLibraryName } from './setLibraryName';

export type { LifecycleProps } from './registerAppEnter';
7 changes: 6 additions & 1 deletion packages/icestark-app/src/registerAppEnter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { setCache } from './cache';

export default (callback?: () => void): void => {
export interface LifecycleProps {
container: HTMLElement | string;
customProps?: object;
}

export default (callback?: (props: LifecycleProps) => void): void => {
if (!callback) return;

if (typeof callback !== 'function') {
Expand Down
3 changes: 2 additions & 1 deletion packages/icestark-app/src/registerAppLeave.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { setCache } from './cache';
import type { LifecycleProps } from './registerAppEnter';

export default (callback?: () => void): void => {
export default (callback?: (props: LifecycleProps) => void): void => {
if (!callback) return;

if (typeof callback !== 'function') {
Expand Down

0 comments on commit 84dead4

Please sign in to comment.