Skip to content

[TypeScript] Fix default Error type for data provider hooks - #11322

Merged
fzaninotto merged 2 commits into
masterfrom
fix/error-types-for-some-hooks
Jul 28, 2026
Merged

[TypeScript] Fix default Error type for data provider hooks#11322
fzaninotto merged 2 commits into
masterfrom
fix/error-types-for-some-hooks

Conversation

@erwanMarmelab

Copy link
Copy Markdown
Contributor

Closes #11262

Description

onError should have callback function with same signature as useUpdate i.e. (error: Error) => void not (error: unkonwn) => void)

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • [ ] The PR includes unit tests (if not possible, describe why)
  • [ ] The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@erwanMarmelab erwanMarmelab added the RFR Ready For Review label Jul 28, 2026
@erwanMarmelab
erwanMarmelab requested a review from pysnooLab July 28, 2026 08:03
@fzaninotto fzaninotto changed the title fix: Error types for some hooks [TypeScript] Fix default Error type for data provider hooks Jul 28, 2026
@fzaninotto
fzaninotto merged commit 898446c into master Jul 28, 2026
15 checks passed
@fzaninotto
fzaninotto deleted the fix/error-types-for-some-hooks branch July 28, 2026 12:04
@fzaninotto fzaninotto added this to the 5.15.2 milestone Jul 28, 2026
@fzaninotto

Copy link
Copy Markdown
Member

This creates compilation failures downstream, so it's a breaking change. I have to revert this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useCreate > onError returns callback function where error is "unknown"

2 participants