Skip to content

Commit

Permalink
fixes react-native-view-overflow issue (#19)
Browse files Browse the repository at this point in the history
* fixes react-native-view-overflow issue
#5

* improved readme

* remove beta since package seems to be working fine with latest RN versions

* remove beta from readme
  • Loading branch information
webraptor authored Sep 20, 2020
1 parent 2ae77de commit a8d5d0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ OR
npm install react-native-deck-swiper --save
```

## Important 2.0.0-beta
## Versions info

Version 2.0.0-beta is technically version 1.7.2 of the package. However, npm recommended that due to the change in ownership the version be bumped.

| react-native-deck-swiper | react-native | description |
| :---------------------------- | :---------------- | :--------------------------------------------------------------------- |
| <= 2.0.3-beta | <= 0.56.x | should install **react-native-view-overflow** and set **useViewOverflow** _true_ |
| >= 2.0.4 | => 0.57.x | no longer requires react-native-view-overflow; **useViewOverflow removed** |

## Issues

Before submitting a new issue please check if it hasn't [already been reported yet](https://github.com/webraptor/react-native-deck-swiper/issues).
Expand Down
10 changes: 3 additions & 7 deletions Swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from 'react'
import { PanResponder, Text, View, Dimensions, Animated } from 'react-native'
import PropTypes from 'prop-types'
import isEqual from 'lodash/isEqual'
import ViewOverflow from 'react-native-view-overflow'

import styles from './styles'

Expand Down Expand Up @@ -694,10 +693,9 @@ class Swiper extends Component {
})

render = () => {
const { pointerEvents, backgroundColor, marginTop, marginBottom, containerStyle, swipeBackCard, useViewOverflow } = this.props
const ViewComponent = useViewOverflow ? ViewOverflow : View
const { pointerEvents, backgroundColor, marginTop, marginBottom, containerStyle, swipeBackCard } = this.props
return (
<ViewComponent
<View
pointerEvents={pointerEvents}
style={[
styles.container,
Expand All @@ -712,7 +710,7 @@ class Swiper extends Component {
{this.renderChildren()}
{swipeBackCard ? this.renderSwipeBackCard() : null}
{this.renderStack()}
</ViewComponent>
</View>
)
}

Expand Down Expand Up @@ -914,7 +912,6 @@ Swiper.propTypes = {
swipeBackCard: PropTypes.bool,
topCardResetAnimationFriction: PropTypes.number,
topCardResetAnimationTension: PropTypes.number,
useViewOverflow: PropTypes.bool,
verticalSwipe: PropTypes.bool,
verticalThreshold: PropTypes.number,
zoomAnimationDuration: PropTypes.number,
Expand Down Expand Up @@ -1009,7 +1006,6 @@ Swiper.defaultProps = {
swipeBackCard: false,
topCardResetAnimationFriction: 7,
topCardResetAnimationTension: 40,
useViewOverflow: true,
verticalSwipe: true,
verticalThreshold: height / 5,
zoomAnimationDuration: 100,
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-deck-swiper",
"version": "2.0.3-beta",
"version": "2.0.4",
"description": "Awesome tinder like card swiper for react-native. Highly Customizable!",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -38,7 +38,6 @@
"prop-types": "15.5.10"
},
"peerDependencies": {
"react-native-view-overflow": "0.0.4",
"react": "^16.0.0-beta.5",
"react-native": "^0.49.1"
},
Expand Down

0 comments on commit a8d5d0d

Please sign in to comment.