[Merge View] - How to update configuration without re-instance the merge view

Hi, I am using the codemirror/merge component with React JS application and am having checkboxes to enable/disable the options like Collapse unchanged and Highlight changes code. each time when I update the Collapse unchanged or highlight changes the Merge component re-instantiates. So that the scroll position goes to the initial position. is there any way to update this config without re-initiate the MergeView component?

even the example of the demo app from this link
https://marijnhaverbeke.nl/upload/merge/

works same. I scroll to mid of the view and changed the config and clicked configure button which re-instantiates and scrolls to the initial position.

@codemirror/merge 0.1.3 adds a reconfigure method for this purpose.

1 Like

@marijn great thanks for update

hello, I have a question now
When I load basicSetup in extensions, I get the error

Here is my code


My English is not very good, please understand

You are loading some version 0.19 packages that were moved into other packages in 6.0 (@codemirror/highlight, @codemirror/stream-parser), which is probably what’s causing this. Make sure npm ls -a | grep @codemirror does not show any 0.x versions.

Thank you, I will try this method

My problem has been solved, thank you