I'm attempting to create a dynamic grid resizing functionality in React and TypeScript by adjusting the lgEditorSize value on onClick action.
Setting the initial lgEditorSize value
const size: any = {};
size.lgEditorSize = 6;
Adjusting the lgEditorSize value
<Box display='flex' justifyContent='right'>
<span>Show or hide the sidebar using</span>
<Button onClick={() => {size.lgEditorSize = 12;}}> <ArrowBackIosIcon/> </Button>
<Button onClick={() => {size.lgEditorSize = 6;}}> <ArrowForwardIosIcon/> </Button>
<span>Button</span>
</Box>
<GridContainer>
<Grid item lg={size.lgEditorSize}>
Contents
</Grid>
<GridContainer>
The value is updated but the grid does not resize. Any suggestions on how to resize the Grid using Button actions?