由于某种原因,QuillJS选择更改缓存结果
我有:
useEffect(() => {
if (quill) {
quill.clipboard.dangerouslyPasteHTML(documentContent);
quill.on('text-change', () => {
setDocumentContent(quill.root.innerHTML);
});
quill.on('selection-change', (range, oldRange, source) => {
console.log(documentState?.predictionStatus, range, oldRange, source);
})
}
}, [quill]);
但documentState.predictionStatus保持其原始值。我想也许是因为该值以某种方式缓存了?
有什么办法解决?
谢谢!