-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example Of Refactoring To Make Files More Descriptive and use jsx instead of js #929
base: main
Are you sure you want to change the base?
Conversation
|
I wasn't familiar with this older CRA convention either. Understanding this helps clarify why it was done that way.
I've heard about the need for explicit extensions with ECMAScript, but haven't needed to implement it in my project, which still runs smoothly without specifying .js or .jsx extensions. (I did have issues when using package.json
I typically organize components like 'settings' under
For components using inline styling, especially with frameworks like MUI that use the sx prop, external CSS files aren't necessary. However, for those that do have associated CSS, structuring folders like this could be more organized:
Once the above are addressed at least for the most part, it would be beneficial to move forward with implementing Vite. Switching to Vite would streamline workflow, significantly reduce server startup times and improve build speeds with efficient Hot Module Reloading (HMR). Overall, transitioning to a clearer structure and simplifying the codebase will enhance the development process greatly. |
@DysektAI I'll say that if you want to take on the monumental effort to rename all react components from This will prepare us better for when we are ready to switch to Vite or Next.js |
1.) There are a LOT of "index.js" files being used to define components as I never seen this before in my time of using react unless using index.js to import multiple components into one file for easier use and access here is the best resource I found that explains this:
2.) Properly use .js and .jsx as explained below which currently is mostly .js extensions in the project.
(The reason why this isn't an apparent issue when using CRA is because it uses webpack and babel under the hood to handle these files no differently)