ckeditor5-react
ckeditor5-react copied to clipboard
getData() onClick rather than onChange
I am using the decoupled editor to import and edit complex word documents. The performance drops significantly when I extract the data using
onChange={ ( e, editor ) => { const data = editor.getData(); console.log( { data } ); }}
Is there a way to extract data onClick only? TIA
@maggie-chintaro It'd suggest debouncing onChange callback passed to your Component using custom React hook. Something like that:
const onDebouncedChange = useDebounce(( e, editor ) => {
const data = editor.getData();
console.log( { data } );
});
...
<CKEditor onChange={onDebouncedChange} ... />