Where to put utility functions?
Answered
ABUL KALAM posted this in #help-forum
Where should I put my utility functions in Next 14 with app router?
And should I put each function in separate file or in a single file?
And should I put each function in separate file or in a single file?
5 Replies
@ABUL KALAM Where should I put my utility functions in Next 14 with **app** router?
And should I put each function in separate file or in a single file?
Northeast Congo Lion
i put them in src/utils/....
Answer
next itself don't have an opinion about that. So you can put it whereever you want to. I prefer putting it next to my component in the specific route. Like that you can group your data and find everything on one view 👠@ABUL KALAM
@ABUL KALAM Where should I put my utility functions in Next 14 with **app** router?
And should I put each function in separate file or in a single file?
I personally put them in
src/utils it depends on you.yea, please mark solution @ABUL KALAM
Asiatic Lion
please dm