Last active
January 30, 2024 12:47
-
-
Save aleksnick/4fe810de830c8a3822fee2736a7a76ee to your computer and use it in GitHub Desktop.
About deps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TableContainer({ columns=[] }) { | |
const [sizes, setSizes] = useState(getSizes(columns)); | |
const onAdd = useCallback((newcolumn) => { | |
columns.push(newColumn); | |
}, [columns]); | |
useEffect(() => { | |
setSizes(getSizes(columns)); | |
}, [columns]); | |
return ( | |
<TableUI | |
columns={columns} | |
sizes={sizes} | |
onAdd={onAdd} | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment