Update plugins properties

I am using Prosemirror through TipTap, using React. I have a custom Linter Plugin (based on the example) where I would like to change some properties dynamically. These properties are at the Editor Component level. How can I “transfer” them into the plugin and ask it to rescan?

I think the only convenient way to do that is to reconfigure your state with a new instance of the plugin.

1 Like

What I’d do is to use the configuration to initiliaze a new plugin state, and update that plugin state during runtime with a command that dispatches a transaction then.

https://prosemirror.net/docs/ref/#state.StateField

Hope that helps!

1 Like

Thanks to both of you for your answers!

I have encountered the same situation as you, i try reconfigure and it work, but reconfigure make a new instance and my other plugs will reinstance again, like this examples ProseMirror tooltip example, it make my editor append decoration element twice or more time, maybe i change Plug class to singleton pattern class will fix ? how do you solve this problem?

Could it be that your plugin is missing a destroy method that cleans up this element?

thx !! it work !!