htm/preact 和 htm 的类型不同
作者: Haroenv创建于 2023年4月7日更新于 2023年4月7日
https://GitHub.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/integrations/preact/index.d.ts#L4 这返回的是 VNode,而如果你使用 htm.bind(h),则推断的返回类型是 VNode | VNode[]
https://GitHub.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/index.d.ts#L2-L4 这两种类型中哪一个是正确的? htm/preact 类型中是否需要对此进行修改?
内容来源: developit/htm