0

I have an event where I want to put a little time in between events.

  <div className="cards">
    {this.state.data.map((merchant, index) => (
      <CardRow
        merchant={{ merchant }}
        count={index}
        className={"card-color-" + index}
        key={merchant.id}
      />
    ))}
  </div>

I want to do something along the lines of

  <div className="cards">
    {this.state.data.map((merchant, index) => (
      <CardRow
        merchant={{ merchant }}
        count={index}
        className={"card-color-" + index}
        key={merchant.id}
      />,
  wait(5000) // Pseudocode
    ))}
  </div>

There's setTimeout, and async/await and I don't think either fits my use-case.

I am trying to do this in React.

Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

0 Answers0