Skip to content

Instantly share code, notes, and snippets.

@Ateevduggal
Created Jun 11, 2022
Embed
What would you like to do?
{
currentData
.filter((val) => {
if (search === "") {
return val;
} else if (val.userName.toLowerCase().includes(search.toLowerCase())) {
return val;
}
})
.map((data) => {
return (
<>
{toggle === data ? (
<EditRow
key={data.id}
tableData={tableData}
setTableData={setTableData}
Cancel={Cancel}
setEditData={setEditData}
editData={editData}
/>
) : (
<ReadOnly key={data.id} data={data} Edit={Edit} Delete={Delete} />
)}
</>
);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment