DEV Community

Discussion on: How do you order your functions?

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

Well, I spend most of my time doing React, which leverages functional components (very similar to a class). So with components, the component itself is the default export. Components can contain any number of functions. Inside the component, I always arrange my functions alphabetically.

In those cases where I'm defining standalone functions to be used across the app, I only ever define one function per file.