gatsby-material-kit-react
gatsby-material-kit-react copied to clipboard
Wrong File-Extensions - jsx
Is there a reason, why you have choose the jsx File-Extension, for all JS-Files in your Project?
Even the material-kit, which you've forked from don't use jsx-filetype at all.
I suggest to better use JSX only for files, which really have JSX-Syntax inside. Else it make no sense... but best choise is to not use jsx-extension at all and stay with the general .js-fileextension.
See here, facebooks recommendadion: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
If you wan't to change this fast and easy, you could do it with this small bash-script:
for x in *.jsx; do mv "$x" "${x%.jx}.js"; done
Thanks @xstable for the info! I'll take a look to this and come back to you asap.
Nice, thanks. BTW, you don't need to add file-extensions if you import a file:
import GridItem from "components/Grid/GridItem.jsx";
import Button from "components/CustomButtons/Button.jsx";
import Parallax from "components/Parallax/Parallax.jsx";
better do it like this:
import GridItem from "components/Grid/GridItem";
import Button from "components/CustomButtons/Button";
import Parallax from "components/Parallax/Parallax";