Mapping an array within a mapped array?

Based on the structure you show, would this work? My code below assumes your code was nested in a div which is rendered. It may not be and you can unjust the code accordingly.

  render() {
    return (
      <div>
        {
          this.state.ideas.map(({title, premises, conclusion}, i) => (
            <div key={i} className="card">
              <div className="card-body">
                <h1>{title}</h1>
                {premises.map((premise, j) => <p key={j}>{premise}</p>)}
                <p>{conclusion}</p>
              </div>
            </div>
          ))
        }
      </div>
    );
  }
};
3 Likes