The importUI function simplifies UI component imports using aliases from a JSON configuration, promoting a modular and organized project structure for improved code manageability.

Example of importing a header file to a listing page.

  • config.json header file:

"aliases": [
        "fileName": "header.tsx",
        "alias": "@header"
  • Listing Page:

import { importUI } from '';

const Header = importUI("");

return (
        <Header />
            {/* Other components */}

Click here to refer GitHub.

Last updated