Some analyzers or transformers are misconfigured in .deepsource.toml
. Please refer to the docs.
293 </CardContent>
294 </Card>
295 {list ? (
296 <TableContainer297 component={Paper}298 className={styles.records}299 onScroll={handleScroll}300 >301 <Table ref={table} stickyHeader>
302 <TableHead>
303 <TableRow>
205 }, 400);
206
207 return (
208 <>209 <Breadcrumbs className={styles.breadcrumbs}>
210 <Typography color="textPrimary">Home</Typography>
211 </Breadcrumbs>
146 <Typography color="textPrimary">Details</Typography>
147 </Breadcrumbs>
148 {item ? (
149 <Card>150 <CardContent>
151 <div className={styles.header}>
152 <Typography variant="h6" component="h2">
218 </Typography>
219 </Grid>
220 {values.headers.map((header, index) => (
221 <Fragment key={header.key}>222 <Grid item xs={12} md={5}>
223 <TextField
224 id={`headers-key-${index}`}
143 };
144
145 return (
146 <>147 <Breadcrumbs className={styles.breadcrumbs}>
148 <RouterLink to="/">
149 <MuiLink component="button" color="textSecondary">
Nesting JSX elements too deeply can confuse developers reading the code. To make maintenance and refactoring easier, DeepSource recommends limiting the maximum JSX tree depth to 4.
Code that looks like this is nearly unreadable for someone unfamiliar:
function App() {
return <Foo>
<Bar>
<Baz>
<div id="deep-div">
Too deeply nested!
</div>
</Baz>
</Bar>
</Foo>
}
function FormContainer() {
// This JSX tree is too deep
return <FormWrapper>
<Form>
<FormEntry>
<Label>
<strong>Name</strong>
</Label>
<FormInput type="text" / >
</FormEntry>
</Form>
</FormWrapper>
}
function FormContainer() {
// the FormEntry component has been modified to accept the labelName and inputType.
// It now returns JSX that contains a label and a field.
return <FormWrapper>
<Form>
<FormEntry labelName="Name" inputType="text">
</FormEntry>
</Form>
</FormWrapper>
}