2021年1月17日星期日

How to use ternary operator inside map

I am trying to use a ternary operator inside a map, but not to sure why this is wrong? Getting a parsing error at the end of the ternary

please ignore:

It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details. It looks like your post is mostly code; please add some more details.

enter image description here

code:

return(      <div className='Card'>      <div className='TableTopbar ScheduleGrid'>        <div>id</div>        <div>interval</div>        <div>project_id</div>        <div>database</div>        <div>create_timestamp</div>        <div>create_user_id</div>        <div>Edit</div>      </div>        {scheduleData.map((schedule)=>           {UsageMode === 'Read' ?         <div className='Table ScheduleGrid'>            <div>{schedule.id}</div>          <div>{schedule.interval}</div>          <div>{schedule.project_id}</div>          <div>{schedule.database}</div>          <div>{schedule.create_timestamp}</div>          <div>{schedule.create_user_id}</div>          <div>            <EditIcon              style=              className='CircleButton'              onClick={onEditScheduleClick}            />          </div>        </div>          :        <div>ID</div>        }      )    )        export default scheduleRowTwo  
https://stackoverflow.com/questions/65767606/how-to-use-ternary-operator-inside-map January 18, 2021 at 09:02AM

没有评论:

发表评论