Skip to content

Instantly share code, notes, and snippets.

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 nafeu/5ec3f49eb42e1caa16011df5316547fd to your computer and use it in GitHub Desktop.
Save nafeu/5ec3f49eb42e1caa16011df5316547fd to your computer and use it in GitHub Desktop.
const [isRowLoading, setIsRowLoading] = useState({});
const handleClickRow = async ({ id }) => {
setIsRowLoading({ [id]: true });
const { data: childData } = await fetchChildData();
setIsRowLoading({ [id]: false })
if (tableData) {
const updatedTableData = recursivelyUpdateTable({ tableData, childData, id });
setTableData(updatedTableData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment