# Migration Guide: v1 to v2

#### 1. Installation

First, ensure you have the latest version of the CheckBox component installed:

```sh
npm install react-native-just-checkbox@latest
```

#### 2. Updated Imports

In v2, make sure to import the CheckBox component from the updated path if it has changed:

```jsx
// v1 import
import CheckBox from 'react-native-just-checkbox';

// v2 import
import { CheckBox } from 'react-native-just-checkbox';
```

#### 3. Handling Animations

Version 2 introduces animations for the CheckBox component. If you want to add animations, specify the `animationType` prop:

```jsx
// v1 usage
<CheckBox
  isChecked={true}
  onToggle={handleToggle}
  squareCheckBox={true}
/>

// v2 usage with animation
<CheckBox
  isChecked={true}
  animationType={"bouncy"}  // "bouncy" or "opacity" or "none"
  borderRadius={8} // instead of "squareCheckBox" props, use "borderRadius" props
  onPress={handleToggle}
/>
```

#### 5. Style and Design Changes

In v2, the CheckBox component supports enhanced styling options. Customize your CheckBox with our new styling props:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><pre class="language-tsx"><code class="lang-tsx">&#x3C;CheckBox
  isChecked={isChecked}
  checkBoxSize={40}
  checkColor="#eef3ff"   
  fillColor="#3d3aff"        
  borderWidth={3}            
  fillMode={true}            
  borderRadius={12}          
  animationType="bouncy"     
  onPress={handleToggle}
/>
</code></pre></td><td></td><td></td><td><a href="https://1395252454-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTHdV5N8ZpjBiQlYESm4%2Fuploads%2FIruH5bSIjs1si46Ijips%2Fimage.png?alt=media&#x26;token=a641dbda-c0ed-4c76-818c-1b2666d21189">image.png</a></td></tr></tbody></table>


---

# Agent Instructions: 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://jinyoungjoh.gitbook.io/react-native-just-checkbox/migration-guide-v1-to-v2.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.
