
TL;DR
When I started my job at my organization, I thought I knew quite well, but there are some practices that I only knew but didn’t im...
For further actions, you may consider blocking this person and/or reporting abuse
By following these essential React practices—structured code organization, optimized API calls, effective state management, smart data loading strategies, and thorough unit testing—you can create applications that scale smoothly, perform efficiently, and remain maintainable for the long term.
While the suggested component structure (imports → constants → function → variables → functions → useEffect → return) has merit. Modern React patterns like custom hooks and the composition of smaller functions might fit neatly into this framework?
For custom Hooks, better declared between variables and functions. Smaller React functions, either you can declare between useEffect and return, or take them completely out of the React function at the bottom.
Really appreciate this honest and practical write-up! It’s refreshing to see someone talk about the gap between knowing best practices and actually applying them especially when working on smaller projects that don’t force you to structure things well until they grow.
Loved the breakdown of the React file structure flow especially placing useEffect after function declarations for clarity. The point about limiting unnecessary API calls hit home too; optimizing those useEffect triggers can make a huge difference in performance and readability.
Thanks for sharing your real-world experience it’s super valuable for junior and mid-level devs who are stepping into more complex codebases!
Glad that you like it, Anik🚀
Thanks, Mr Suraj, for all that you do for the community. I have always followed your posts on LinkedIn and here.
Thank you⚡
Very interesting information, thank you!
Awesome ⭐
Thank you for your, very great written, post.
Thanks a lot! I really appreciate your kind words 😊
Solid tips! The real-world examples make this super relatable, and the API call + unit testing advice is gold for keeping React apps fast and bug-free.
Yep. API and Testing are very crucial. Glad that you like it.