export default ↔ Named Export with default name
export default function f() {}
export default class MyClass {}
export default 123 // any value
export default myFunc
export default MyClass
export default Math.sqrt(2)
export default "a" + "b" + "c"
function wasd() {}
export { wasd as default }
default is illegal Identifier for Variable but can be used as export name (or as Property Key)
Max ONE Default Export allowed for each module
Module itself = default-exported value
Default Export usually for module with single function/class
// export default const not allowed because following would export 1+ value
export default a=1, b=2, c=3
References
loading.tsx↔ ( Next 13 ) Page toexport defaultloading UI on Trigger Suspense Boundarypage.tsx↔ Pageexport defaultUI for Next Route vs dirpath, default Server Component - else"use client"opt-inlayout.tsx↔ ( Next 13 ) Page toexport defaultlayout UI to share withchildrennot-found.tsx↔ ( Next 13 ) Page toexport defaultUI for Catch All Routeerror.tsx↔ ( Next 13 ) Page toexport defaultUI on Trigger Error Boundaryhead.tsx↔ ( Next 13 ) Page toexport default<head\>for each Page Route[id].tsx↔ ( Next 12 ) FC toexport defaultPage with Dynamic Route with_idURL ParameterStory↔export defaultObject to Declaratively render FC snapshot with specific key state to dev/test/doc
<code>export</code> default {
title "Button",
component: Button
}
<code>export</code> const ButtonRed = () => <Button label="Press me" backgroundColor="red" /\>
Page↔export defaultFC to display unique UI fornextFile System Router