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

TypeScript: m.fragment without Attrs not allowed #43

Open
ArthurClemens opened this issue Mar 13, 2021 · 1 comment
Open

TypeScript: m.fragment without Attrs not allowed #43

ArthurClemens opened this issue Mar 13, 2021 · 1 comment
Assignees

Comments

@ArthurClemens
Copy link

Error:

Expected 2 arguments, but got 1.ts(2554)
index.d.ts(57, 71): An argument for 'children' was not provided.

image

This can be solved by adding a second entry in the d.ts:

/** Creates a fragment virtual element (Vnode). */
fragment(attrs: Lifecycle<any, any> & { [key: string]: any }, children: ChildArrayOrPrimitive): Vnode<any, any>;
fragment(children: ChildArrayOrPrimitive): Vnode<any, any>;
@dead-claudia dead-claudia transferred this issue from MithrilJS/mithril.js Mar 14, 2021
@dead-claudia
Copy link
Member

@spacejack Also, the TS defs need updated to accept variadic children to align with the current hyperscript API (the ...args in m(Comp, ...args) and in m.fragment(...args) is handled the exact same way behind the scenes, so they should have identical prototypes).

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

3 participants