Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icejs 提供的 router 相关 API 缺少类型提示 #4145

Closed
ClarkXia opened this issue Mar 9, 2021 · 1 comment
Closed

icejs 提供的 router 相关 API 缺少类型提示 #4145

ClarkXia opened this issue Mar 9, 2021 · 1 comment
Assignees

Comments

@ClarkXia
Copy link
Collaborator

ClarkXia commented Mar 9, 2021

从 ice 中导入的 history、withRouter 等 API 缺少类型提示

@xmsz
Copy link

xmsz commented Apr 14, 2021

  1. useHistory导出的history类型还是any
const history = useHistory();
  1. block类型和history的不同
    history里的是
export interface Update<S extends State = State> {
    /**
     * The action that triggered the change.
     */
    action: Action;
    /**
     * The new location.
     */
    location: Location<S>;
}
/**
 * A change to the current location that was blocked. May be retried
 * after obtaining user confirmation.
 */
export interface Transition<S extends State = State> extends Update<S> {
    /**
     * Retries the update to the current location.
     */
    retry(): void;
}
/**
 * A function that receives transitions when navigation is blocked.
 */
export interface Blocker<S extends State = State> {
    (tx: Transition<S>): void;
}

但ice的是

type Blocker = ( location: Location , action: Action) => void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants