Next.js · Junior · Question 28 of 75

Why give a folder a name with an underscore, e.g. app/_components?

Explanation

Private folders explicitly separate helper code from routes. Strictly speaking, files without page/route aren't public anyway, but _ protects against accidentally creating a route and makes the structure clearer.

Further reading

Problem with a question

Next.js · Junior · question 28

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz