I want to design the registration form in the react js. But I want to optimize the code as much as I can. I am successful in the traditional way that by using a lot of tr and td in form. what I want to achieve by using the javascript map function and want each row to contain three labels then the next row should start. I am not able to figure it out. will you help me out. Below is my JSX code.
{RegistrationData && RegistrationData.map((item,key)=>{
let row=false
if(key===0 || key===3)
row=true
else
row=false
return(
<>
{row && <tr>
<h1>{item.label}</h1>
</tr>}
</>
);
})
}