You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve Form to stash schemaUtils.rootSchema as state.schema (#4687)
To assist potential future transformations of the `rootSchema` in the `schemaUtils` updated `Form` to always use that as the `state.schema`
- In `@rjsf/utils`:
- Added `getRootSchema()` to the `SchemaUtilsType` and `createSchemaUtils()`
- Updated the tests to maintain 100% coverage
- In `@rjsf/core`:
- Updated `Form` to always pull the `rootSchema` from the `schemaUtils` and put it into the `state.schema`, making sure to use that in the `render()`, `getStateFromProps()` and `getRegistry()`
- Updated the `test_utils.js` to pass the `validator` in the `setProps()` function
- Updated `CHANGELOG.md` accordingly
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,18 @@ should change the heading of the (upcoming) version to include a major version b
18
18
19
19
# 6.0.0-beta.12
20
20
21
+
## @rjsf/core
22
+
23
+
- Updated `Form` to store the `schemaUtils.getRootSchema()` into the `state.schema` and use that everywhere as the `schema`
24
+
21
25
## @rjsf/shadcn
22
26
23
27
- Updated the building of `shadcn` to use the `lodashReplacer` with `tsc-alias` fixing [#4678](https://github.com/rjsf-team/react-jsonschema-form/issues/4678)
24
28
29
+
## @rjsf/utils
30
+
31
+
- Updated `SchemaUtils` and `createSchemaUtils()` to add a new `getRootSchema()` function
// If retrievedSchema is undefined which means the schema or formData has changed, we do not merge state.
449
450
// Else in the case where it hasn't changed, we merge 'state.errorSchema' with 'schemaValidation.errorSchema.' This done to display the raised field error.
0 commit comments