score:0

import React, { lazy, Suspense } from "react";

const file = `${__dirname}/components/MyComponent`;

const MyComponent = lazy(() => import(file));
export default function App() {
  return (
    <Suspense fallback="Loading">
        <MyComponent />
    </Suspense>
  );
}

Related Query

More Query from same tag