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
componentDetector
inAutoField
s 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.- Dropped support for
initialCount
in bridges andListField
s. Pass a model object to the form with the appropriate amount of initial items instead. AutoFields
component in all themes now renders aReact.Fragment
instead of adiv
. Explicitly render a wrapper component around if you need one.- Removed the
autoField
prop fromQuickForm
,AutoForm
, andAutoFields
components in all themes. UseAutoField.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.