Fix inconsistent behavior of useAsyncValue
and useCKEditorCloud
hooks on Vite
and Next
runtimes.
#541
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested merge commit message (convention)
Fix: Behavior of
useCKEditorCloud
hook is now consistent onVite
andNext
runtimes while changing properties.Internal: Fix incorrect typings of
useAsyncCallback
anduseAsyncValue
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:
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.