Skip to content

fix(types): omit unsupported defaultValue prop - #773

Merged
jaywcjlove merged 1 commit into
uiwjs:masterfrom
Hanan88:codex/omit-unsupported-default-value
Nov 24, 2026
Merged

jaywcjlove merged 1 commit into
uiwjs:masterfrom
Hanan88:codex/omit-unsupported-default-value

Conversation

@Hanan88

@Hanan88 Hanan88 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #743.

defaultValue is inherited from React's div attributes, so TypeScript accepts it even though it does not initialize the editor. Omit it from ReactCodeMirrorProps (and consequently UseCodeMirror) and document using value for editor content. Callers using the unsupported prop will now get a type error; editor behavior is unchanged.

Add a consumer fixture against the built CJS declarations covering component and hook rejection of defaultValue, valid value/native attributes/refs, and rejection of numeric values. Run it in CI after the build using the existing TSBB compiler.

Validation:

  • The fixture fails against the original declarations with two unused @ts-expect-error errors and passes after the fix.
  • npm run build: all 48 packages passed; theme runtime dependency check passed.
  • npm run coverage: 25 tests passed (9 core, 16 language extension). The run logs a CodeMirror/JSDOM layout measurement warning.
  • Browser bundles (normal/minified), documentation production build, Prettier, and git diff --check passed.

Prepared with AI assistance.

@jaywcjlove
jaywcjlove merged commit a0e1af3 into uiwjs:master Nov 24, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Nov 24, 2026
Co-authored-by: Hanan88 <29348717+Hanan88@users.noreply.github.com> a0e1af3
jaywcjlove added a commit that referenced this pull request Nov 24, 2026
github-actions Bot pushed a commit that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omit the confusing defaultValue type from props

2 participants