Exporting shared UI components from the same file
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
I’m working on a next.js 14 app.
Does exporting and importing shared UI components from an index file prevent code splitting? is it a bad practice?
— UI
—— Button
—— Dropdown
—— ….
—— index.tsx
where index.tsx does:
export * from “./Buttonâ€
export * from “./Dropdownâ€
And in the pages/components I’m doing:
import { Button } from “@/components/uiâ€
Does exporting and importing shared UI components from an index file prevent code splitting? is it a bad practice?
— UI
—— Button
—— Dropdown
—— ….
—— index.tsx
where index.tsx does:
export * from “./Buttonâ€
export * from “./Dropdownâ€
And in the pages/components I’m doing:
import { Button } from “@/components/uiâ€