items.map(item => {
return(
<tr key={item.id}>
<td>{item.id}</td>
<td>{item.heading}</td>
<td style={{width:"7.5%"}}>
<img className="bar-sm"src={item.image} alt="pic error" style=
{{width:'70px',height:'35px'}}/>
</td>
<td>
if (item.status === 0) {
return (
<>
<button type="button" className="btn btn-sm btn-secondary btn-toggle" data-toggle="button" aria-pressed="false" autocomplete="off"onClick={() =>Switch(item.status,item.id)}>
<div className="handle"></div>
</button>
</>
)
}
</td>
<td>{item.slug}</td>
<td>{item.category.name}</td>
Asked
Active
Viewed 24 times
-1

Felix Kling
- 795,719
- 175
- 1,089
- 1,143

vim kndll
- 19
- 1
- 6
-
code is working fine error only occur when i use the if condtion I need to check the fetch data in map – vim kndll Sep 30 '20 at 10:50