Skip to content

Fix 3146 by implementing useFileWidgetProps hook#4818

Merged
heath-freenome merged 3 commits intorjsf-team:mainfrom
heath-freenome:fix-3146-and-4803
Oct 28, 2025
Merged

Fix 3146 by implementing useFileWidgetProps hook#4818
heath-freenome merged 3 commits intorjsf-team:mainfrom
heath-freenome:fix-3146-and-4803

Conversation

@heath-freenome
Copy link
Copy Markdown
Member

@heath-freenome heath-freenome commented Oct 27, 2025

Reasons for making this change

Fixes #3146 by refactoring FileWidget in core to make the useFileWidgetProps() hook
Fixed #4803 by deleting the FileWidget in daisyui, moving the key "type-file" elements into BaseInputTemplate

  • In @rjsf/core refactored the FileWidget file extraction and callbacks into the new useFileWidgetProps() hook in @rjsf/utils
  • In @rjsf/daisyui refactored the key type=file elements from FileWidget into BaseInputTemplate, deleting the FileWidget entirely in favor of the core one
  • In @rjsf/mantine updated the FileWidget to use the useFileWidgetProps() hook
  • In @rjsf/utils exported the useFileWidgetProps() hook and its associates types
    • Also added 100% unit tests for the new hook
  • Updated the utility-functions.md and v6.x upgrade guide.md to document the new hook
  • Updated the CHANGELOG.md accordingly

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Comment thread packages/utils/src/useFileWidgetProps.ts
Comment thread packages/utils/test/useFileWidgetProps.test.ts
Comment thread CHANGELOG.md Outdated
Fixes rjsf-team#3146 by refactoring `FileWidget` in `core` to make the `useFileWidgetProps()` hook
Fixed rjsf-team#4803 by deleting the `FileWidget` in `daisyui`, moving the key "type-file" elements into `BaseInputTemplate`
- In `@rjsf/core` refactored the file extraction and callbacks into the new `useFileWidgetProps()` hook in `@rjsf/utils`
- In `@rjsf/daisyui` refactored the key `type=file` elements from `FileWidget` into `BaseInputTemplate`, deleting the `FileWidget` entirely in favor of the `core` one
- In `@rjsf/mantine` updated the `FileWidget` to use the `useFileWidgetProps()` hook
- In `@rjsf/utils` exported the `useFileWidgetProps()` hook and its associates types
  - Also added 100% unit tests for the new hook
- Updated the `utility-functions.md` and `v6.x upgrade guide.md` to document the new hook
- Updated the `CHANGELOG.md` accordingly

# Conflicts:
#	CHANGELOG.md
@heath-freenome heath-freenome merged commit 87517f9 into rjsf-team:main Oct 28, 2025
4 checks passed
@heath-freenome heath-freenome deleted the fix-3146-and-4803 branch October 28, 2025 21:39
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.

file widget returns 'must be string' for @rjsf/daisyui on submit Customize FileWidget.

2 participants