> For the complete documentation index, see [llms.txt](https://redd.gitbook.io/react-advanced-form/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://redd.gitbook.io/react-advanced-form/general/migration/1.4.x-1.5.x.md).

# 1.4.x → 1.5.x

Release `1.5` includes crucial architecture rewrite to allow new features in the future.

## Removed ImmutableJS

ImmutableJS is no longer a peer dependency of React Advanced Form. Having `react` alone is now sufficient to use your favorite form library!

{% hint style="success" %}
Uninstall `immutable` package from your project in case you do not use it.
{% endhint %}

## Deprecated `withImmutable`

Consequentially after removing immutable from library's dependencies, we deprecated the usage of immutable instances in various callback methods provided by the form. Please use plain JavaScript data types from now on.

`FormProvider` and `Form` components no longer support `withImmutable` prop.

#### Before:

```jsx
const registerUser = ({ fields }) => {
  /* "fields" is the instance of Immutable.Map */
  const username = fields.get('username')
  const value = username.get('value')
}

<Form action={registerUser} withImmutable>
  <Input name="username" />
</Form>
```

#### After:

```jsx
const registerUser = ({ fields }) => {
  /* "fields" is a plain Object */
  const { username } = fields
  const { value } = username
}

<Form action={registerUser}>
  <Input name="username" />
</Form>
```

{% hint style="success" %}
Remove `withImmutable` prop and (optionally) re-write the usage of immutable instances in callback arguments to use plain JavaScript primitives.
{% endhint %}

## Deprecated `fields` in rule resolvers

A rule resolver that references another field is expected to become [reactive](/react-advanced-form/architecture/reactive-props.md#reactive-validation-rules). Previously, we have used Proxy on fields Object to flush the references fields. However, to enable at least IE11 support we reworked the functionality and introduces a dedicated `get` function for reactive field references.

```jsx
const validationRules = {
  name: {
    confirmPassword: ({ get, value, fieldProps, form }) => {
      return (value === get(['password']))
    },
  },
}
```

{% hint style="success" %}
Replace `fields.foo.bar` by `get(['foo', 'bar'])` in the validation rules resolvers.
{% endhint %}

## Changed `fieldProps.ref`

The reference to a field component is now available via `fieldProps.getRef()`.

#### Before:

```jsx
const validateUsername = ({ fieldProps }) => {
  const field = fieldProps.ref
}

<Input
  name="username"
  rule={validateUsername} />
```

#### After:

```jsx
const validateUsername = ({ fieldProps }) => {
  const field = fieldProps.getRef()
}

<Input
  name="username"
  rule={validateUsername} />
```

{% hint style="info" %}
Replace `fieldProps.ref` by `fieldProps.getRef()` whenever it has been used.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://redd.gitbook.io/react-advanced-form/general/migration/1.4.x-1.5.x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
