Document Editor Method in React

According to: Methods, " After initializing document editor you will get the object that can be used to call the methods.". How to get this method if i use React?

I have read React and it never manually initialize document editor.

My component code:

export default function OnlyofficeDoc() {
  return (
    <div className="w-screen h-screen">
      <DocumentEditor
        id="docxEditor"
        documentServerUrl="http://localhost:80"
        config={document.data}
        events_onDocumentReady={onDocumentReady}
        onLoadComponentError={onLoadComponentError}
        events_onRequestRename={onRequestRename}
        events_onMetaChange={onMetaChange}
        events_onRequestHistory={onRequestHistory}
      />
    </div>
  );
}

I use latest ONLYOFFICE Docs Community Edition for Docker version on local server