I am trying to show all the subfolders and files in the “data” folder of my project as dropdown elements in the Front End of one of my page.tsx files in my Next JS application, but I can’t find a way to do this without hardcoding the directories…
Is there a simple way to do this?
I tried using useState, getStaticProps, etc. but always end up with errors in the compilation process…
New contributor
Xavier Palou Oliver is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.