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

After passing generics to Component, the methods cannot automatically infer the function types and default to Function #329

Open
anran758 opened this issue Aug 6, 2024 · 0 comments

Comments

@anran758
Copy link

anran758 commented Aug 6, 2024

/**
 * 页面中参与渲染的数据
 */
type ComponentData = typeof DEFAULT_DATA

/**
 * 页面中的方法
 */
interface ComponentMethods extends WechatMiniprogram.Component.MethodOption {}

/**
 * 页面的静态实例
 */
interface ComponentInstanceProperty {
  $unbindDialog?: WechatMiniprogram.Component.TrivialInstance
}

Component<ComponentData, {}, ComponentMethods, ComponentInstanceProperty, true>

image
image

Does the official source have more recommended practices?

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

1 participant