Closed mrv1k closed 3 years ago
Example used both expression and declaration. README is fairly long so I copy pasted it here. It was this:
export default function Layout({children}) => <main>{children}</main> All the things.
Considered 3 options: Named function declaration. Verbose but descriptive. (Proposing this one)
export default function Layout({ children }) { return <main>{children}</main>; }
Anonymous arrow function expression. Short but vague, what's the default export used again?
export default ({ children }) => <main>{children}</main>;
Named arrow function expression. Looks weird, export to export?
export const Layout = ({ children }) => <main>{children}</main>; export default Layout;
Nice catch, thank you!
Example used both expression and declaration. README is fairly long so I copy pasted it here. It was this:
Considered 3 options: Named function declaration. Verbose but descriptive. (Proposing this one)
Anonymous arrow function expression. Short but vague, what's the default export used again?
Named arrow function expression. Looks weird, export to export?