https://github.com/punksta/react-native-auto-collapsible
React-native view which automatically collapses or expands on content size changes
https://github.com/punksta/react-native-auto-collapsible
react react-native react-native-component react-native-library
Last synced: about 1 month ago
JSON representation
React-native view which automatically collapses or expands on content size changes
- Host: GitHub
- URL: https://github.com/punksta/react-native-auto-collapsible
- Owner: punksta
- Created: 2019-03-24T20:10:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-24T20:42:47.000Z (about 7 years ago)
- Last Synced: 2026-03-14T18:10:22.635Z (3 months ago)
- Topics: react, react-native, react-native-component, react-native-library
- Language: JavaScript
- Size: 467 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-auto-collapsible
React-native view which automatically collapses or expands when content changes height.

## purpose
Useful for lists of items with dynamic contents to avoid jumping on view height change
https://snack.expo.io/Sy0l5vruE - demo
## usage
1) install `npm install react-native-auto-collapsible --save` / `yarn add react-native-auto-collapsible`
2) use
```javascript
import AutoCollapsible from "react-native-auto-collapsible"
const render = (props) => (
)
```
or as HOC
```javascript
import {AutoCollapsibleHOC} from "react-native-auto-collapsible"
const CollapsibleMyComp = AutoCollapsibleHOC({})(MyComp);
```
## Props
- resizeAnimation - sets custom animation
```javascript
resizeAnimation = (animatedValue, newHeight) =>
Animated.spring(animatedValue, {
toValue: newHeight,
duration: 200
})
```