8000 fix: 🐛 add missing props for lifecycles by maoxiaoke · Pull Request #440 · ice-lab/icestark · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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