> For the complete documentation index, see [llms.txt](https://colorfy-software.gitbook.io/react-native-modalfy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://colorfy-software.gitbook.io/react-native-modalfy/2.x/guides/upgrading.md).

# Upgrading from v1.x

We tried to keep the breaking changes as minimal as possible. As of now, here is the list of the changes we know you'll have to make if you're coming from Modalfy v1:

## API

### modal.getParams() ➜ modal.getParam()

We drop the support for the generic `getParams(defaultValue)` in favour of `getParam(paramName, defaultValue)` which gives us a much more fine-grained control. &#x20;

`getParams()` was returning the whole `params` variable or the `defaultValue` if we didn't provide any params to the modal. `getParam()` in the other hand allows us to access every single `params` key independently (granting `params` is an object), and `defaultValue` now applies to that specific key, instead of the whole `params` object.&#x20;

### backButtonBehavior ➜ backBehavior

This change applies wherever we were defining this key inside `modalOptions` object. We dropped the `Button` part as pressing the backdrop now supports `backBehavior`.

## Types

### Flow ➜ TypeScript

The library has been completely rewritten from Flow to TypeScript. We deciced to drop support for the former to only pursue with the latter. If you feel like Flow support is essential to you, feel free to submit a PR with updated [Flow definitions](https://github.com/flow-typed/flow-typed)!

### ModalStackOptions ➜ ModalOptions

Given that this type isn't only used when creating the stack, it didn't make sense to include it in the name.

### ModalStackItemProp ➜ ModalComponentProp

If you were already using the TypeScript definition files, `ModalStackItemProp` used in the modal components files has been replaced by `ModalComponentProp`. Check out its updated section in the [**TypeScript guide**](/react-native-modalfy/2.x/guides/typing.md#modalcomponentprop) to see how it's used.

### ModalProp ➜ ModalProp (with props & params now)

If you were already using the TypeScript definition files, `ModalProp` used in regular components has been updated by a more complete/simpler to use `ModalProp`. Check out its updated section in the [**TypeScript guide**](/react-native-modalfy/2.x/guides/typing.md#modalprop) to see how it's used.

{% hint style="success" %}
This guide is a work in progress! As more people upgrade their apps we can continue to improve it. Please send pull requests to add any suggestions that you have from your upgrade experience.
{% 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, and the optional `goal` query parameter:

```
GET https://colorfy-software.gitbook.io/react-native-modalfy/2.x/guides/upgrading.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
