7function LoginPage() {
8 const { loginWithRedirect } = useAuth0();
9 return (
10 <Box position={"absolute"} top={"25%"} width={"100%"}>11 <Box display={"flex"} justifyContent="center">
12 <Box width="60%" >
13 <Box width={"80%"} padding={"5% 10%"}>
6
7function Footer() {
8 return (
9 <Box 10 style={{ 11 height: "370px", 12 width: "95%", 13 padding:'2%', 14 backgroundColor:'#F1F6F4', 15 textAlign:'left' 16 }} 17 > 18 <Box
19 style={{
20 height: "272px",
185 }
186
187 return (
188 <StyledEngineProvider>189 <Card sx={{ maxWidth: "284px" }}>
190 <CardMedia
191 component="img"
81 getBookById();
82 });
83 return (
84 <StyledEngineProvider> 85 <Box minHeight={"100vh"}>
86 <Box width="90%" padding="0% 5%">
87 <Box paddingTop="25px">
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>
}