score:0

const routes = (isLoading) => [
  {
    path: "/",
    element: <Main isLoading={isLoading} />
  }
];

score:0

const routes = (props) => [
  {
    "/": () => <Main {...props} />
  }
];
    
    
    const App = ({ isLoading }) => {
      const routing = useRoutes(routes(isLoading));

      return (
           <>
               {routing}
               {JSON.stringify(isLoading)}
           </>
      )
    };

score:1

    const routes = (props) => [
      {
        path: "/",
        element: <Main {...props} />
      }
    ];
    
    const App = ({ isLoading }) => {
      const routing = useRoutes(routes({isLoading}));
      return (
        <>
          {routing}
          {JSON.stringify(isLoading)}
        </>
      );
    };

Related Query

More Query from same tag