So, I have a working Gatsby with dato starter project. while I was going through the code I have found src/posts/{DatoCmsPost.slug}.js file.
From the behavior, I could understand it is like a template. But when I try to change the name of the js file it crashes and I am confused why it is crashing over the change of file name.
- why do we use curly braces in the file name?
- how do we generate the name of the file if that is the case?
- how does it get the url-slug inside the component?