Skip to content
This repository has been archived by the owner on Feb 10, 2020. It is now read-only.

Not rendering any cards #4

Open
ThomasDebrunner opened this issue Feb 4, 2017 · 2 comments
Open

Not rendering any cards #4

ThomasDebrunner opened this issue Feb 4, 2017 · 2 comments

Comments

@ThomasDebrunner
Copy link

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
Copy link
Owner

alexandre-garrec commented Feb 6, 2017

Can you try with the css file in storybook/style.css ?

master-root need a size

@dmoli
Copy link

dmoli commented Aug 9, 2017

@alexandre-garrec I had the same problem, I think that you must to specify that the CSS is necessary to run it successfully.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants