I am using the OnlyOffice component in a React project and encountering an issue when trying to refresh the history data using the refreshHistory method. The method is being called within the onRequestHistory callback, but it throws a TypeError indicating that refreshHistory is not a function.
Here's the relevant code snippet:
TypeError: editor.refreshHistory is not a function
I have tried accessing the refreshHistory method through event.target.docEditor, but it doesn't seem to be available.
Additional context:
I am using the OnlyOffice component in a React project.
The OnlyOffice component is initialized with the necessary props and configurations.
The onRequestHistory callback is triggered when the history data needs to be refreshed.
I have followed the documentation and examples provided for integrating OnlyOffice in a React project.
I would appreciate any guidance or suggestions on how to properly refresh the history data using the OnlyOffice component in a React environment. If there are any changes in the API or recommended approaches, please let me know.
in other words :
From where i can get the docEditor instance in the document-editor-react implementation.
Hi samsam002, you can get the docEditor instance like this:
var docEditor = window.DocEditor.instances[id]
where id is the сomponent unique identifier.
I am using the OnlyOffice component in a React project and encountering an issue when trying to refresh the history data using the refreshHistory method. The method is being called within the onRequestHistory callback, but it throws a TypeError indicating that refreshHistory is not a function. Here's the relevant code snippet:
The error message received is:
TypeError: editor.refreshHistory is not a function
I have tried accessing the refreshHistory method through event.target.docEditor, but it doesn't seem to be available.
Additional context:
I am using the OnlyOffice component in a React project. The OnlyOffice component is initialized with the necessary props and configurations. The onRequestHistory callback is triggered when the history data needs to be refreshed. I have followed the documentation and examples provided for integrating OnlyOffice in a React project. I would appreciate any guidance or suggestions on how to properly refresh the history data using the OnlyOffice component in a React environment. If there are any changes in the API or recommended approaches, please let me know.
in other words : From where i can get the docEditor instance in the document-editor-react implementation.