onBeforeRender
event (#628).preserveScroll
and preserveState
(#628).It's very common to want to preserve scrolling or state only in the event that there are validation errors. Previously you had to use a callback to do this:
preserveScroll: (page) => Object.keys(page.props.errors).length > 0,
preserveState: (page) => Object.keys(page.props.errors).length > 0,
However, both of these options now support a new "errors"
option, which does this automatically:
preserveScroll: "errors",
preserveState: "errors",