react-native-accordion-list-view
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "react-native-accordion-list-view", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Animated accordion collapsable List for react native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,2 +35,12 @@ ## react-native-accordion-list-view | ||
## Important Note | ||
This plugin work with Layout Animation and In order to get this to work on Android you need to set the following flags via UIManager: | ||
```javascript | ||
if (Platform.OS === 'android') { | ||
if (UIManager.setLayoutAnimationEnabledExperimental) { | ||
UIManager.setLayoutAnimationEnabledExperimental(true); | ||
} | ||
} | ||
``` | ||
### Demo | ||
@@ -63,4 +73,4 @@ <p> | ||
```javascript | ||
import React from 'react'; | ||
import {View, SafeAreaView, StyleSheet, Text} from 'react-native'; | ||
import React, { useEffect } from 'react'; | ||
import {View, SafeAreaView, StyleSheet, Text, Platform, UIManager} from 'react-native'; | ||
import {AccordionList} from 'react-native-accordion-list-view'; | ||
@@ -81,2 +91,9 @@ | ||
]; | ||
useEffect(() => { | ||
if (Platform.OS === 'android') { | ||
if (UIManager.setLayoutAnimationEnabledExperimental) { | ||
UIManager.setLayoutAnimationEnabledExperimental(true); | ||
} | ||
} | ||
}, []); | ||
return ( | ||
@@ -113,4 +130,4 @@ <SafeAreaView> | ||
|-------------------|--------------------------|-----------|---------------------|--------------------------------------------------------------------------------------------------| | ||
| customTitle | (item) => JSX.Element | Yes | | Function that returns a React element to display as Accordion title | | ||
| customBody | (item) => JSX.Element | Yes | | Function that returns a React element to display as Accordion body | | ||
| customTitle | () => JSX.Element | Yes | | Function that returns a React element to display as Accordion title | | ||
| customBody | () => JSX.Element | Yes | | Function that returns a React element to display as Accordion body | | ||
| customIcon | () => JSX.Element | No | keyboard-arrow-left | Function that returns a React element to display as Accordion icon | | ||
@@ -124,4 +141,4 @@ | containerStyle | ViewStyle | No | {} | Styling for Accordion item container view | | ||
```javascript | ||
import React from 'react'; | ||
import {View, SafeAreaView, StyleSheet, Text, ScrollView} from 'react-native'; | ||
import React, {useEffect} from 'react'; | ||
import {View, SafeAreaView, StyleSheet, Text, ScrollView, Platform, UIManager} from 'react-native'; | ||
import {AccordionItem} from 'react-native-accordion-list-view'; | ||
@@ -142,2 +159,9 @@ | ||
]; | ||
useEffect(() => { | ||
if (Platform.OS === 'android') { | ||
if (UIManager.setLayoutAnimationEnabledExperimental) { | ||
UIManager.setLayoutAnimationEnabledExperimental(true); | ||
} | ||
} | ||
}, []); | ||
return ( | ||
@@ -144,0 +168,0 @@ <SafeAreaView> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16556
9
188