So I have react application using material-ui to create tabs.
<div className={classes.root}>
<AppBar position="static">
<Tabs value={value} onChange={handleChange}>
<Tab label="Item One" />
<Tab label="Item Two" />
<Tab label="Item Three" />
</Tabs>
</AppBar>
{value === 0 && <TabContainer id={1}>Item One</TabContainer>}
{value === 1 && <TabContainer id={2}>Item Two</TabContainer>}
{value === 2 && <TabContainer id={3}>Item Three</TabContainer>}
</div>
The TabContainer functional component does some heavy computation.
Is it possible to prevent TabContainer from re-rendering when switching between tabs?
In order to prevent TabContainer from re-rendering. You have to
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am using Jest framework for unit testing and came across a scenario to mock the fsreadFile
I want to structure my routerjs file as currently there is around 500 lines of code in it
I was shown my data in am4chartsIntially i was create x axis with id field but now i want time fields
the react docs said that is better to use the setState(updaterFunc) rather than the setState(object) because it will have the latest stateI know setState is async, that's why we use the setState(updaterFunc) to have the latest state