Open phocks opened 1 year ago
I thought they were already? https://github.com/abcnews/aunty/blob/main/src/generators/project/templates/react/src/components/App/index.tsx
Ahh yes my mistake .tsx seems to be implemented, but not .jsx
Probably not overly urgent, but .jsx support could be sort of easy to implement
I also noticed a strange bug where if you generate a project and NOT choose TypeScript it adds this in your index.js file which includes : any
which is typescript. Small bug, I'll track it down and open another issue.
if (module.hot) {
module.hot.accept('./components/App', () => {
try {
renderApp();
} catch (err: any) {
import('./components/ErrorBox').then(({ default: ErrorBox }) => {
root.render(<ErrorBox error={err} />);
});
}
});
}
Yeah, so you'd just rename with the new extension if isTS
is false? Sounds like a good idea to me.
It seems to be becoming a standard now that any JavaScript and TypeScript files that contain JSX syntax have the full
.jsx
or.tsx
so I'm suggesting we update our React and Preact templates to use these filenames and add import support to WebPack (I don't think it handles these file types currently).