diff --git a/js/src/common/Component.ts b/js/src/common/Component.ts index d433907df..08e6d3e76 100644 --- a/js/src/common/Component.ts +++ b/js/src/common/Component.ts @@ -65,18 +65,7 @@ export default class Component implements ClassC } render() { - return m.fragment( - { - ...this.props, - oninit: (...args) => this.oninit(...args), - oncreate: (...args) => this.oncreate(...args), - onbeforeupdate: (...args) => this.onbeforeupdate(...args), - onupdate: (...args) => this.onupdate.bind(...args), - onbeforeremove: (...args) => this.onbeforeremove.bind(...args), - onremove: (...args) => this.onremove.bind(...args), - }, - this.view() - ); + return m(this.constructor, this.props); } static component(props: ComponentProps | any = {}, children?: Mithril.Children) { diff --git a/js/src/forum/components/CommentPost.tsx b/js/src/forum/components/CommentPost.tsx index ea0ebe477..dc382051a 100644 --- a/js/src/forum/components/CommentPost.tsx +++ b/js/src/forum/components/CommentPost.tsx @@ -20,7 +20,7 @@ export default class CommentPost extends Post { */ revealContent: boolean = false; - postUser: Vnode<{}, PostUser>; + postUser!: Vnode<{}, PostUser>; oninit(vnode) { super.oninit(vnode); diff --git a/js/src/forum/components/IndexPage.tsx b/js/src/forum/components/IndexPage.tsx index d5e174f95..89063a372 100644 --- a/js/src/forum/components/IndexPage.tsx +++ b/js/src/forum/components/IndexPage.tsx @@ -76,7 +76,7 @@ export default class IndexPage extends Page { view() { if (!app.cache.discussionList) return; - const discussionList = m(DiscussionList, app.cache.discussionList.props); + const discussionList = app.cache.discussionList.render(); return (
diff --git a/js/src/forum/components/NotificationGrid.tsx b/js/src/forum/components/NotificationGrid.tsx index b8e046573..3c3c96d48 100644 --- a/js/src/forum/components/NotificationGrid.tsx +++ b/js/src/forum/components/NotificationGrid.tsx @@ -15,7 +15,7 @@ export type NotificationItem = { name: string; /** - * The icon to display in the column header/notificatio grid row. + * The icon to display in the column header/notification grid row. */ icon: string; @@ -60,6 +60,7 @@ export default class NotificationGrid extends Component { state: !!preference, disabled: typeof preference === 'undefined', onchange: () => this.toggle([key]), + oninit: vnode => (this.inputs[key] = vnode.state), }); }) );