Why npx-create-next-app without App router dont create .jsx files instead create .js?
Answered
Somali posted this in #help-forum
SomaliOP
By convention, files containing jsx markup must have the extension .jsx otherwise .js, next-create-app creates .js files in the pages dir.
Does this mean that next wants me to create something like views folder from which to import .jsx markup into pages.js files?
Does this mean that next wants me to create something like views folder from which to import .jsx markup into pages.js files?
6 Replies
@Somali By convention, files containing jsx markup must have the extension .jsx otherwise .js, next-create-app creates .js files in the pages dir.
Does this mean that next wants me to create something like views folder from which to import .jsx markup into pages.js files?
.js files work fine, .jsx is not required
Answer
The same doesn’t hold for .ts and .tsx however
@joulev .js files work fine, .jsx is not required
SomaliOP
yes, work fine, but convention..
Well I answered your question. Nextjs doesn’t require or want you to create a view folder or anything of the sort
Of course you are free to rename it to .jsx, which I would do as well if I didn’t use typescript