ariel-walley / dnd-app

2 stars 0 forks source link

Where to place the "export default"? #52

Open ariel-walley opened 2 years ago

ariel-walley commented 2 years ago

Should it be:

function() {} export default function;

OR

export default function() {}

Which is considered best practice?

MelodyLayne commented 2 years ago

From what I've learned there's no consensus but there is a guide - if you have more than one function that is being exported(which I'm told you should generally avoid) then export default function( ) { } is the only way. But if you are only doing one function to one file, then it doesn't matter beyond preference.