Repository navigation
[BIX-8750]: Accept nullable block-skeleton scroll refs - #38
Merged
Merged
Conversation
React 19 no longer includes null implicitly in RefObject<T>. Make null explicit in the public and hook options, matching the existing runtime fallback and remaining compatible with React 18.
srubin
marked this pull request as ready for review
September 22, 2026 16:08
srubin
requested review from
anjoola and
paulinang
and removed request for
anjoola
September 22, 2026 16:08
paulinang
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
React 19 no longer includes null implicitly in
RefObject<T>. Draft.js's block-skeleton options therefore reject the nullable scroll refs that Descript passes, although the hook already handles null by falling back to the editor contents element.Accept
RefObject<HTMLElement | null>in both options. This works with React 18 and React 19 without a custom compatibility type. Extend the existing skeleton-promotion test to exercise both mounted and null scroll refs. Production JavaScript is unchanged.Related to BIX-8750 and descriptinc/descript#45317. No package release or Descript dependency bump is included.
Test Plan
inerterrors remain.The fork's plain source typecheck already fails on missing Node ambient types and newer standard-library APIs. With explicit Node types and ES2020 libraries, the React 18 source check passes. The equivalent React 19 source check retains three pre-existing callback-ref return errors in DraftEditorBlock, DraftEditorLeaf, and DraftEditorTextNode; those are outside this PR.