How I write React after 8 years
Almost 100% of this post is completely wrong.<p>Don&#x27;t use 3rd party libraries:  NIH syndrome is plaguing our industry like a disease already.  Can&#x27;t wait until companies realize they need half the devs they do now.  Our industry needs a wake up call, especially for immature developers who waste company money<p>Forms don’t have to suck:  Just use hook form, or use uncontrolled forms.  Or better yet if you have a simple form don&#x27;t use a frontend library at all.<p>Any component that expects a state has a hook:  Please God no.  Write code.  When you write it 3 times abstract it.<p>CSS: Use styled components:  No<p>Components:  No, use flat file structure.  Don&#x27;t use the whole Folder&#x2F;index mess.  It&#x27;s a nightmare.  Just do Button.tsx, UserFeed.txt &#x2F; etc.  Put components next to feature unless they&#x27;re generic.  Just use tailwind.<p>Split the routes using loadable components or the equivalent in Next: Ok.<p>Folder Structures: No<p>Decoupling logic from components:  100% never do this.  Ever.<p>Native like Page Transition:  No.  Don&#x27;t use animations for page transitions on web or PWA&#x27;s.  Those are reserved for actual native apps.<p>Context’s:  Don&#x27;t use Context, unless it&#x27;s literally for if the user is logged in.  Everything else should use some kind of 3rd party library (Mobx, Redux, Recoil, Zustand) that uses subscriptions to circumvent React&#x27;s extremely slow and outdated way of rendering.  Alternative: Use react-query for most date fetching &#x2F; global state.