Skip to content

Plugin API tab options beforeDestroy to control react root unmount before tab element destroyed #8467

Closed
@zuoez02

Description

@zuoez02
Contributor

In what scenarios do you need this feature?

I create an excalidraw plugin for display excalidraw file in a tab. But when close the tab, error occured.
image
I need to run root.unmount() before the element of content destroyed. Thx

Describe the optimal solution

Add an option in this.addTab(options),

// run this code before
addTab({
/// ...
  beforeDestroy() {
    // unmount your app
  }
)}

Describe the candidate solution

No response

Other information

No response

Activity

self-assigned this
on Jun 7, 2023
added this to the 2.9.1 milestone on Jun 7, 2023
added a commit that references this issue on Jun 12, 2023
changed the title [-]Plugin API: tab options 'beforeDestroy' to control react root unmount before tab element destroyed[/-] [+]Plugin API tab options `beforeDestroy` to control react root unmount before tab element destroyed[/+] on Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Vanessa219@zuoez02

      Issue actions

        Plugin API tab options `beforeDestroy` to control react root unmount before tab element destroyed · Issue #8467 · siyuan-note/siyuan