fix: Component.component argument typings (#3148)

This commit is contained in:
David Wheatley 2021-11-04 22:38:50 +01:00 committed by GitHub
parent 9a275e8e1b
commit 64b9c818d6

View File

@ -121,8 +121,8 @@ export default abstract class Component<Attrs extends ComponentAttrs = Component
*
* @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children
*/
static component(attrs = {}, children = null): Mithril.Vnode {
const componentAttrs = Object.assign({}, attrs) as Record<string, unknown>;
static component(attrs: Attrs = {}, children: Mithril.Children = null): Mithril.Vnode {
const componentAttrs = { ...attrs };
return m(this as any, componentAttrs, children);
}