We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6572bf4 commit 07ed5c7Copy full SHA for 07ed5c7
packages/richtext-lexical/src/features/blocks/client/componentInline/index.tsx
@@ -285,6 +285,10 @@ export const InlineBlockComponent: React.FC<Props> = (props) => {
285
// cleanup effect
286
useEffect(() => {
287
return () => {
288
+ // If the component is unmounted, either via removeInlineBlock or via lexical itself,
289
+ // we need to reset the cacheBuster to force a re-fetch of the initial state when it gets mounted again e.g. via lexical history undo.
290
+ // Otherwise it would use a potentially outdated initial state, if the inline block was edited before it got removed.
291
+ prevCacheBuster.current = -1
292
abortAndIgnore(onChangeAbortControllerRef.current)
293
}
294
}, [])
0 commit comments