Next.js Discord

Discord Forum

Where to put utility functions?

Answered
ABUL KALAM posted this in #help-forum
Open in Discord
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?
Answered by Northeast Congo Lion
i put them in src/utils/....
View full answer

5 Replies

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
yea, please mark solution @ABUL KALAM
Asiatic Lion
please dm