-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
useUrlState 设置ts类型识别不到 #2618
Comments
怎么划线了,没问题了吗? |
Hi, yqw19920202. It seems that this issue is a bit vague and lacks some necessary information. 看起来这条 issue 描述得有些模糊,缺少一些必要的信息。 |
declare const useUrlState: (initialState?: S | (() => S) | undefined, options?: Options) => readonly [Partial<{ [key in keyof S]: any; }>, (s: React.SetStateAction<Partial<{ [key in keyof S]: any; }>>) => void]; |
这个hook希望setState添加第二个参数,可以设置navigateMode, |
Since the issue was labeled with |
declare const useUrlState:
(initialState?: S | (() => S) | undefined, options?: Options) => readonly [Partial<{ [key in keyof S]: any; }>, (s: React.SetStateAction<Partial<{ [key in keyof S]: any; }>>) => void];这泛型传递后,所有的参数的值都是any类型,应该改成下面这样的吧,不知道正不正确
declare const useUrlState:
(initialState?: S | (() => S) | undefined, options?: Options) => readonly [Partial<{ [key in keyof S]: S[key]; }>, (s: React.SetStateAction<Partial<{ [key in keyof S]: S[key]; }>>) => void];The text was updated successfully, but these errors were encountered: