squint

zachcp 2025-05-20T14:19:06.553099Z

Q: In Next.js routing your files are the routes but you need to export a default component. The below component works. Is this the best/only way to export the default fn?

(ns pages.about)

(defn About []
  #jsx [:div "About"])

;; Export the component as default
(def ^:export default About)

zachcp 2025-05-20T14:20:35.107809Z

# for reference.

├── app
│   ├── favicon.ico
│   ├── globals.css
│   ├── layout.js
│   ├── page.cljs
│   └── page.jsx
└── pages
    ├── about.cljs
    └── about.jsx

borkdude 2025-05-20T14:26:07.567979Z

yes, you don't need the ^:export metadata though, public functions are always exported

👍 1