Skip to content

Missing await in React example #1

@keanemind

Description

@keanemind

It seems the return value of createForum is a Promise<ForumAPI> that should be awaited. Without adding the await, componentWillUnmount runs into an error because this.forum has the wrong type.

this.forum = createForum(boardID, this.containerRef.current, options);

While we're at it, since this.forum might not exist yet when the component is being unmounted, perhaps the componentWillUnmount implementation should be this.forum?.destroy();.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions