What's causing my React sidebar to jitter whenever a new page loads?
P粉055726146
P粉055726146 2024-03-21 22:14:24
0
1
322

For context, I'm using the React-Bootstrap library. Whenever I click on the href in the code, the sidebar jitters for half a second, almost like it resets to its unstyled state and then returns to its normal form. Does anyone know why this is happening? Is it because my code is too slow? Here is my sidebar code:

import React from "react";
import "../../App.css";
import { Nav, Navbar } from "react-bootstrap";
import ProfileSection from "./ProfileSection";
import ContactBar from "./ContactBar";
import HomeItem from "./SidebarItems/HomeItem";
import BlogItem from "./SidebarItems/BlogItem";
import WorkItem from "./SidebarItems/ProjectItem";
import PhilItem from "./SidebarItems/PhilItem";
import { Container } from "@mui/system";

function Sidebar() {
    return (
        <Navbar expand="lg">
            <Container>
                <Navbar.Toggle aria-controls="responsive-navbar-nav" />
                <Navbar.Collapse id="responsive-navbar-nav">
                    <Nav defaultActiveKey="/" className="flex-column">
                        <ProfileSection />
                        <HomeItem />
                        <BlogItem />
                        <WorkItem />
                        <PhilItem />
                        <ContactBar />
                    </Nav>
                </Navbar.Collapse>
            </Container>
        </Navbar>
    )
};

export default Sidebar;

P粉055726146
P粉055726146

reply all(1)
P粉478445671

Your code works fine on my device.. Must be some internet or device issue. I also checked your code and there is nothing wrong with your code. Once deployed there is no need to worry about it working properly.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template