Migrating v3 to v4
This guide is designed to help you through the migration. If you went through it and encountered any problems - do let us know. For more information on why certain changes were made, see the CHANGELOG.md. When migrating to v4, use the newest version. Gradual updates will take more time and won't ease this process.
Breaking API changes
AutoFields
component in all themes now renders aReact.Fragment
instead of adiv
. Explicitly render a wrapper component around if you need one.- Dropped support for
initialCount
in bridges andListField
s. Pass a model object to the form with the appropriate amount of initial items instead. - Removed the
autoField
prop fromQuickForm
,AutoForm
, andAutoFields
components in all themes. UseAutoField.componentDetectorContext.Provider
instead. componentDetector
inAutoField
components now always takes precedence overcomponent
property on a schema. This may make yourAutoField
render a different component when you were using both previously. If that's the case, move your schema'scomponent
definition to aAutoField.componentDetectorContext.Provider
instead.- The constructors for all our bridges now accept an object (e.g.,
{schema, validator}
) instead of individual parameters. This applies toSimpleSchema2Bridge
,JSONSchemaBridge
, andZodBridge
. Please update your constructor calls accordingly. getInitialValue
returns empty array or object instead ofundefined
forListField
andNestField
.Bridge.getProps
method accepts onlyname
argument now. Additional arguments are no longer supported.- Replaced
allowedValues
withoptions
prop - AntD theme uses
v5
ofantd
package. Update your project to usev5
ofantd
package. - MUI theme uses
v6
of@mui/material
package. Update your project to usev6
of@mui/material
package. - Initial render doesn't trigger individual field
onChange
functions anymore. #1343
Deprecated packages
The following packages are deprecated and are no longer supported in v4.0.0.
- Deprecate
uniforms-bootstrap3
package - Deprecate
uniforms-material
package - Deprecate
uniforms-bridge-simple-schema
package - Deprecate
uniforms-bridge-graphql
package
If you want to continue using these packages, we recommend staying with uniforms v3, as we don't guarantee they will work with the newer versions. You can use the following commands to download the 3.10.2
version of the package:
npx gitget https://github.com/vazco/uniforms/tree/v3.10.2/packages/<uniforms-package-name>