Skip to content

Commit

Permalink
fix(type): Add the missed parameter to useRouter
Browse files Browse the repository at this point in the history
`useRouter` supports pass an optional parameter to indicate whether the the router should be dynamic or not. But it was missed in the type definitions.

See https://github.com/NervJS/taro/blob/93c6d6e18f29ab2c2844da8641746b55d6a7df18/packages/taro-runtime/src/dsl/hooks.ts#L81
  • Loading branch information
yuezk authored and ZakaryCode committed Sep 27, 2020
1 parent b930029 commit d27aefc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro/types/taro.hooks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare namespace Taro {
/**
* 获取当前路由参数。
*/
function useRouter<TParams extends Partial<Record<string, string>> = Partial<Record<string, string>>>(): RouterInfo<TParams>
function useRouter<TParams extends Partial<Record<string, string>> = Partial<Record<string, string>>>(dynamic?: boolean): RouterInfo<TParams>

/**
* 导航栏的标题被点击时的回调。
Expand Down

0 comments on commit d27aefc

Please sign in to comment.