-Below is my code
import { DocumentEditor } from ‘@onlyoffice/document-editor-react’;
import { useEffect, useState } from ‘react’;
import { onlyOfficeService } from ‘…/…/service/onlyOffice/onlyOffice.service’;
import config from ‘…/…/config/config’;
import { useParams } from ‘react-router-dom’;
const onDocumentReady = function () {};
export const DocEditorIndex = () => {
const params = useParams();
const file_id = params.id;
const [docConfig, setDocConfig] = useState(null);
useEffect(() => {
if (file_id) {
onlyOfficeService.getConfig(file_id || ‘’).then((res) => {
setDocConfig(res);
});
}
}, [file_id]);
console.log(docConfig, ‘docConfig’);
const handleChange = (editorChanges: any) => {
console.log(editorChanges);
};
const events_onMakeActionLink = (event: any) => {
console.log(event);
};
return (
<>
{docConfig !== null ? (
<DocumentEditor
id=“docEditor”
documentServerUrl={config.documentServerUrl || ‘’}
height=“800px”
document_title=“asad”
config={{
…docConfig,
}}
events_onMetaChange={handleChange}
events_onDocumentReady={onDocumentReady}
events_onMakeActionLink={events_onMakeActionLink}
/>
</div>
) : (
<p>Still Processing</p>
)}
</>
);
};