Open DanaIliescu opened 6 years ago
@DanaIliescu track the bug down and submit a PR with the upgrade maybe? I'm quite sure @alexandre-garrec would approve :smiley:
@DanaIliescu I got the same problem, did you fixed it yet?
never mind. I change the default react/react-dom version in the library package.json file, reinstall the dependence, and everything works like expected.
Yeah, @alexandre-garrec, if you could add support for React 16 it would be amazing!
CHeck out this fork, works for me now https://github.com/damien-mcmahon/react-swipe-card
@stenmuchow this worked for me to fix the offsetWidth. The display worked but then I got the following while swipping and was unable to fix it yet. Uncaught TypeError: this.props[("onSwipe" + direction)] is not a function
Fixed it by adding () => So the readme instructions become:
import Cards, { Card } from 'react-swipe-card'
const data = ['Alexandre', 'Thomas', 'Lucien']
const Wrapper = () => {
return (
<Cards onEnd={() => action('end')} className='master-root'>
{data.map(item =>
<Card
onSwipeLeft={() => action('swipe left')}
onSwipeRight={() => action('swipe right')}>
<h2>{item}</h2>
</Card>
)}
</Cards>
)
}
CHeck out this fork, works for me now https://github.com/damien-mcmahon/react-swipe-card
When installing this via npm, React doesn't seem to be finding it:
npm install https://github.com/damien-mcmahon/react-swipe-card -g
I keep getting module not found
Fixed it by adding () => So the readme instructions become:
import Cards, { Card } from 'react-swipe-card' const data = ['Alexandre', 'Thomas', 'Lucien'] const Wrapper = () => { return ( <Cards onEnd={() => action('end')} className='master-root'> {data.map(item => <Card onSwipeLeft={() => action('swipe left')} onSwipeRight={() => action('swipe right')}> <h2>{item}</h2> </Card> )} </Cards> ) }
@leonardmaguin how do you import the "action" method above? The way I used to do this, Importing action
depends on from @kadira/storybook, relies on React 15.xx, which will cause npm to try to use two versions of React in the same project.
anyone tries it with React 16? I encountered the same error! Please help.
@nghiaoi3 I did not have success in finding a solve for this issue...
I've just recently came across this package which I think is great in terms of progressive web app and not native, but it seems like it doesn't support React 16. With the most basic example I get
TypeError: cannot read property 'offsetWidth' of null
After downgrading to React 15.4.2 everything worked. Any chances it will support latest version soon?