react-native-auto-collapsible
v1.0.0
Published
React-native view which automatically collapses or expands on content size changes
Downloads
6
Readme
react-native-auto-collapsible
React-native view which automatically collapses or expands when content changes.
purpose
Useful for lists of items with dynamic contents to avoid jumping on view height change
usage
- install
npm install react-native-auto-collapsible --save
/yarn add react-native-auto-collapsible
- use
import AutoCollapsible from "react-native-auto-collapsible"
const render = (props) => (
<AutoCollapsible>
<MyComp {...props}/>
</AutoCollapsible>
)
or as HOC
import {AutoCollapsibleHOC} from "react-native-auto-collapsible"
const CollapsibleMyComp = AutoCollapsibleHOC({})(MyComp);
Props
- resizeAnimation - sets custom animation
resizeAnimation = (animatedValue, newHeight) =>
Animated.spring(animatedValue, {
toValue: newHeight,
duration: 200
})