Fix: Behavior of useCKEditorCloud hook is now consistent on Vite and Next runtimes while changing properties.
Internal: Fix incorrect typings of useAsyncCallback and useAsyncValue callback arguments types.
Tests: Add missing cleanup methods to few tests.
Additional information
It looks like useRef behavior is inconsistent across React frameworks, and it is not related to React version itself (at least 18.x one, 19.x is not affected at all).
Let's assume this component that is being rendered in strict mode:
On Next.js it will print null the first time, and then test second time.
It looks like something changed somewhere in React world and second approach is no longer consistent across frameworks. At the time of creating useInstantEffect it was. It affects our useCKEditorCloud which uses useInstantEffect under the hood, which may work differently across frameworks above. This PR normalizes it.
Suggested merge commit message (convention)
Fix: Behavior of
useCKEditorCloud
hook is now consistent onVite
andNext
runtimes while changing properties. Internal: Fix incorrect typings ofuseAsyncCallback
anduseAsyncValue
callback arguments types. Tests: Add missingcleanup
methods to few tests.Additional information
It looks like
useRef
behavior is inconsistent across React frameworks, and it is not related to React version itself (at least 18.x one, 19.x is not affected at all).Let's assume this component that is being rendered in strict mode:
null
two times.null
the first time, and thentest
second time.It looks like something changed somewhere in React world and second approach is no longer consistent across frameworks. At the time of creating
useInstantEffect
it was. It affects ouruseCKEditorCloud
which usesuseInstantEffect
under the hood, which may work differently across frameworks above. This PR normalizes it.