I am looping through a set of items in a reactjs component. I'm trying to wrap the items in a div every 3 items.
            {
              lang.carouselFeatures[0].items.map(function (item, index) {
                return (
                  {
                    index % 3 === 0
                      ? <div className='row'>
                      : null
                  }
                  <div key={index} className='medium-18 medium-offset-2 columns'>
                    <a rel='nofollow' href='#page-01-med'>
                      <div className='relative-container'>
                        <img className='icn__large icn--no-margin-bottom centered' src={Thumb1} />
                        <div className='icn--hover__features' />
                      </div>
                      <p className='text--center paragraph-margin-top-10'>Live Video Interviews</p>
                    </a>
                  </div>
                  {
                    index % 3 === 0
                      ? </div>
                      : null
                  }
                )
              })
            }
I am trying to recreate this static piece of markup, so also need to add to the wrapper an additional class if its not the first series. Answers/Suggestions welcome. 
///fixed
    {
     lang.carouselFeatures[0].items.reduce((m, k, i) => {
       if (i % 3 === 0) {
         m.push([k])
       } else {
         m[m.length - 1].push(k)
       }
       return m
     }, []).map((grouped, index) => (
       <div key={index} className='row'>
         {
           grouped.map((item, j) =>
             <div key={j} className='medium-18 medium-offset-2 columns'>
               <a rel='nofollow' href='#page-01-med'>
                 <div className='relative-container'>
                   <img className='icn__large icn--no-margin-bottom centered' src={item.image} />
                   <div className='icn--hover__features' />
                 </div>
                 <p className='text--center paragraph-margin-top-10'>{item.title}</p>
               </a>
             </div>
            )
         }
       </div>
      ))
    }
 
     
     
    