Load new document

How do I load a completely new document into editor?

I’m having troubles understanding transactions in general. I understand the concept but I can’t get how to create appropriate transactions for the editor.

Create a new state, and use setState to put it into your view.