Skip to content

useMap is wrongly declared with type UseMap<any, any> instead of UseMap<K, V> #185

@Jisu-Woniu

Description

@Jisu-Woniu

The two definitions

export type UseMap<K = any, V = any> = (
/**
* @zh 初始值,可以为 Map 实例、数组或者一个初始化的函数
* @zh-Hant 初始值,可以為 Map 實例、數組或者一個初始化的函數
* @en The initial value of the map. It can be a Map instance, an array of key-value pairs, or a function that returns initial entries.
*/
initialValue?: Map<K, V> | readonly (readonly [K, V])[] | (() => Map<K, V> | readonly (readonly [K, V])[])
) => {

export const useMap: UseMap = <K, V>(
initialValue?: Map<K, V> | readonly (readonly [K, V])[] | (() => Map<K, V> | readonly (readonly [K, V])[]),
) => {

made useMap function having type UseMap<any, any>:

Image

Also, the function useMap does not accept type parameters, making it impossible to specify the concrete type.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions