I use CodeMirror in my react component. I have a use case where I need to pass state information from the parent component to CodeMirror Editor, and the editor needs to change based on the state information. How do I pass state information to the CodeMirror Editor ?
Also how do I keep track of state information (for example if the dialog is open or close etc) within CodeMirror, so that the next event gets the latest value ?
You generally define a state field to hold your extra state, set up its update method to check for state effects you define for the purpose, and fire transactions with such effects to update it.