Skip to content

Conversation

heath-freenome
Copy link
Member

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

Reasons for making this change

The work to convert ObjectField to stateless functional components with some optimizations

  • In @rjsf/utils:
    • BREAKING CHANGE: Updated FieldTemplateProps and WrapIfAdditionalTemplateProps to replace the onKeyChange() and onDropPropertyClick() callback generator props with the onKeyRename(), onKeyRenameBlur() and onRemoveProperty() callback props
    • BREAKING CHANGE: Updated ObjectFieldTemplateProps to replace the onAddClick() callback generator prop with the onAddProperty() callback prop
    • Added new hook useDeepCompareMemo() and its associated tests
  • In @rjsf/core:
    • Updated ObjectField to refactor the code from a class component to two stateless functional components, replacing the 3 generator-props with the 4 memoized props mentioned in the @rjsf/utils changes
    • Updated Form to "memoize" the fieldPathId and registry into the FormState, adding a toIChangeEvent() helper to restrict the state returned on the IChangeEvent interface callbacks
    • Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • In the rest of the themes, updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated the custom-templates.md documentation to reflect the additionalProperties-based interface props replacement
  • Updated the utility-functions.mf documenation to add the new useDeepCompareMemo() hook
  • Updated the v6.x upgrade guide.md documentation to add the BREAKING CHANGES to the FieldTemplateProps, ObjectFieldTemplateProps and WrapIfAdditionalTemplateProps interface props changes and the useDeepCompareMemo() 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

@heath-freenome heath-freenome force-pushed the stateless-object-field branch 3 times, most recently from 245b7ea to c2ff855 Compare October 15, 2025 06:41
The work to convert `ObjectField` to a stateless functional component with some optimizations
@heath-freenome heath-freenome changed the title DRAFT: Chore: Convert ObjectField to a stateless component Chore: Convert ObjectField to a stateless component Oct 15, 2025
@heath-freenome heath-freenome changed the title Chore: Convert ObjectField to a stateless component Chore: Convert ObjectField to a function components Oct 15, 2025
@heath-freenome heath-freenome changed the title Chore: Convert ObjectField to a function components Chore: Convert ObjectField to function components Oct 16, 2025
@heath-freenome heath-freenome merged commit 803c813 into rjsf-team:main Oct 16, 2025
4 checks passed
@heath-freenome heath-freenome deleted the stateless-object-field branch October 16, 2025 16:03
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.

2 participants