1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

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 809df29d29
commit 8c47b197f0

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);
}