Not rendering any cards
ThomasDebrunner opened this issue · 2 comments
ThomasDebrunner commented
In my most basic example, I can't manage to get the cards appear on the screen.
import Cards, { Card } from 'react-swipe-card'
export default class Stack extends Component {
render() {
const { actions, children, login } = this.props
const data = ['Alexandre', 'Thomas', 'Lucien']
return (
<div className={style.normal}>
<Header>Stack</Header>
<Cards onEnd={() => console.log('end')} className='master-root'>
{data.map((item, i) =>
<Card key={i}
onSwipeLeft={() => console.log('swipe left')}
onSwipeRight={() => console.log('swipe right')}>
<h2>{item}</h2>
</Card>
)}
</Cards>
</div>
)
}
}
All it renders is a div with the master-root
class set, but without any children. Any idea what could go wrong?
alexandre-garrec commented
Can you try with the css file in storybook/style.css ?
master-root need a size
dmoli commented
@alexandre-garrec I had the same problem, I think that you must to specify that the CSS is necessary to run it successfully.