Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeat #280

Closed
Maxhodges opened this issue Jun 26, 2016 · 2 comments
Closed

repeat #280

Maxhodges opened this issue Jun 26, 2016 · 2 comments

Comments

@Maxhodges
Copy link
Contributor

often I want to repeat an element. Like if I have a complex ui card and I want several on the screen, is there a way to write an extension or something so I could have my ui card element repeat a few times?

storiesOf('Mailbox', module)
  .add('card view', () => (
    <div className="page header">
      <div className="ui container">
        <div className="ui cards">
          <div repeat="3" className="ui card">
...
@roonyh
Copy link
Contributor

roonyh commented Jun 26, 2016

You can put javascript expressions inside JSX. So using map to get an array of ui card elements works.

 storiesOf('Mailbox', module)
  .add('card view', () => (
    <div className="page header">
      <div className="ui container">
        <div className="ui cards">
          {[1,2,3].map(i => (<div className="ui card">stuff</div>))}
        </div>

@arunoda
Copy link
Member

arunoda commented Jun 26, 2016

I think @roonyh answered this.

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

No branches or pull requests

3 participants