I’m trying to understand line widget lifecycle to be able to manage them. In particular, I’d like to control when line widgets get created and removed.
Right now I’m using the controlled component from
react-codemirror2 (effectively for the purposes of this question - when there is a value change, it calls
editor.setValue). This, however, removes any line widgets that I’ve added. So I’d have the following questions about line widget lifecycle:
- which events remove them? (listening to all
updateevents feels wrong)
- is there a way to prevent their removal through certain updates?
- when they are removed by CodeMirror, is there a special event that is called? (I’m aware I can force removal through