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();.
It seems the return value of
createForumis aPromise<ForumAPI>that should be awaited. Without adding the await,componentWillUnmountruns into an error becausethis.forumhas the wrong type.integration-examples/React/PeerBoard.jsx
Line 50 in 5ed5450
While we're at it, since
this.forummight not exist yet when the component is being unmounted, perhaps thecomponentWillUnmountimplementation should bethis.forum?.destroy();.