inertia@0.8.7

Published on April 14, 2021
  • Remove internal onBeforeRender event (#628).
  • Add "errors" option to preserveScroll and preserveState (#628).

New "errors" preserve option

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",