diff --git a/packages/icestark-app/CHANGELOG.md b/packages/icestark-app/CHANGELOG.md index 12ce1bbc..cf7f259f 100644 --- a/packages/icestark-app/CHANGELOG.md +++ b/packages/icestark-app/CHANGELOG.md @@ -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)) diff --git a/packages/icestark-app/package.json b/packages/icestark-app/package.json index 3ce29234..7e103d0a 100644 --- a/packages/icestark-app/package.json +++ b/packages/icestark-app/package.json @@ -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", diff --git a/packages/icestark-app/src/index.ts b/packages/icestark-app/src/index.ts index 72042d47..0cf77553 100644 --- a/packages/icestark-app/src/index.ts +++ b/packages/icestark-app/src/index.ts @@ -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'; diff --git a/packages/icestark-app/src/registerAppEnter.ts b/packages/icestark-app/src/registerAppEnter.ts index 44fded3b..c534c62f 100644 --- a/packages/icestark-app/src/registerAppEnter.ts +++ b/packages/icestark-app/src/registerAppEnter.ts @@ -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') { diff --git a/packages/icestark-app/src/registerAppLeave.ts b/packages/icestark-app/src/registerAppLeave.ts index 9c1794d0..0163e031 100644 --- a/packages/icestark-app/src/registerAppLeave.ts +++ b/packages/icestark-app/src/registerAppLeave.ts @@ -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') {