creativetimofficial / material-dashboard-react

React version of Material Dashboard by Creative Tim
https://www.creative-tim.com/product/material-dashboard-react
MIT License
2.82k stars 4.14k forks source link

jerky when shifting from dashboard to tables. #218

Open sant527-sms-magic opened 1 year ago

sant527-sms-magic commented 1 year ago

I am using a material ui template.

The below is my Tables.js

// Material Dashboard 2 React example components
import DashboardLayout from "examples/LayoutContainers/DashboardLayout";
import DashboardNavbar from "examples/Navbars/DashboardNavbar";

// Data
function Tables() {
  return (
    <DashboardLayout>
      <DashboardNavbar />
      Testing
    </DashboardLayout>
  );
}

export default Tables;

and Dashboard.js

import DashboardLayout from "examples/LayoutContainers/DashboardLayout";
import DashboardNavbar from "examples/Navbars/DashboardNavbar";

// Data
function Dashboard() {
  return (
    <DashboardLayout>
      <DashboardNavbar />
      Testing
    </DashboardLayout>
  );
}

export default Dashboard;

and the routes.js is

// Material Dashboard 2 React layouts
import Dashboard from "layouts/dashboard";
import Tables from "layouts/tables";
import Billing from "layouts/billing";
import RTL from "layouts/rtl";
import Notifications from "layouts/notifications";
import Profile from "layouts/profile";
import SignIn from "layouts/authentication/sign-in";
import SignUp from "layouts/authentication/sign-up";

// @mui icons
import Icon from "@mui/material/Icon";

const routes = [
  {
    type: "collapse",
    name: "Notifications",
    key: "notifications",
    icon: <Icon fontSize="small">notifications</Icon>,
    route: "/notifications",
    component: <Notifications />,
  },
  {
    type: "collapse",
    name: "Profile",
    key: "profile",
    icon: <Icon fontSize="small">person</Icon>,
    route: "/profile",
    component: <Profile />,
  },
  {
    type: "collapse",
    name: "Dashboard",
    key: "dashboard",
    icon: <Icon fontSize="small">dashboard</Icon>,
    route: "/dashboard",
    component: <Dashboard />,
  },
  {
    type: "collapse",
    name: "Tables",
    key: "tables",
    icon: <Icon fontSize="small">table_view</Icon>,
    route: "/tables",
    component: <Tables />,
  },

  {
    type: "collapse",
    name: "Billing",
    key: "billing",
    icon: <Icon fontSize="small">receipt_long</Icon>,
    route: "/billing",
    component: <Billing />,
  },
  {
    type: "collapse",
    name: "RTL",
    key: "rtl",
    icon: <Icon fontSize="small">format_textdirection_r_to_l</Icon>,
    route: "/rtl",
    component: <RTL />,
  },
  {
    type: "collapse",
    name: "Sign In",
    key: "sign-in",
    icon: <Icon fontSize="small">login</Icon>,
    route: "/authentication/sign-in",
    component: <SignIn />,
  },
  {
    type: "collapse",
    name: "Sign Up",
    key: "sign-up",
    icon: <Icon fontSize="small">assignment</Icon>,
    route: "/authentication/sign-up",
    component: <SignUp />,
  },
];

export default routes;

Ofcourse the above is mainly w.r.t to the free template material dashboard

Now I am see small flipping of the elements when i navigate between pages. I am not sure why this is happening

the below is the video recording to help to understand what i am saying.

When i clicking on Dashboard and tables, the elements jump in the beginning.

Whereas we can see there is no jumping for Notifications and Profile.

enter image description here