Skip to content

Instantly share code, notes, and snippets.

@Ateevduggal
Created June 11, 2022 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ateevduggal/644a39ecc9cec2a9c3e9ebba828c6c5e to your computer and use it in GitHub Desktop.
Save Ateevduggal/644a39ecc9cec2a9c3e9ebba828c6c5e to your computer and use it in GitHub Desktop.
{
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