bit-by-bit
bit-by-bit10mo ago

jsx in js

All of my files containing JSX are in .js files. Is there an easy fix for this when running?
4 Replies
ioB
ioB10mo ago
Ideally the files would be .jsx, but you can always use the --ext flag to specify jsx manually i.e.
$ deno run --ext=jsx file.js
$ deno run --ext=jsx file.js
bit-by-bit
bit-by-bit10mo ago
My original file is a JS one which imports App.js.. and that imports subcomponents. Do I need to rename everything?
ioB
ioB10mo ago
Ideally yes, .js is semantically the wrong extension. If you're running unix, you can try https://unix.stackexchange.com/questions/708979/bash-recursive-rename-of-js-files-to-jsx to do this automatically. You can try https://gist.github.com/mustafaturan/32df16bb4c49fbd837f777000f4b9aa2 if you're on windows.
bit-by-bit
bit-by-bit10mo ago
kk thanks. nah, running linux. not a big deal to rename everything