We use React for most projects, so this guide mostly leans toward best practices for React and libraries that use (or work well with) React.
There are tons of opinion around project structure, each with it's own pros and cons. We currently use our own template for most (Web application) projects. It also opinionated and made a handful of choices that worked well for us:
With the introduction of React Hooks, function components can now handle their own states and effects (previously known as "life-cycle") without using Class component. Our team has been early adopter of React Hooks since alpha and having good success, thus we recommend using React Hooks for local states and effects handling, this awesome article by Dan Abramov explains some pitfalls and mis-conceptions of developers while using Class components and how React Hooks make them obvious to avoid by default.
for (let i = 0; i < items.length; i++)
everyover any types of mutable
TailwindCSS covers most things, but if you ever feel the need of writing custom styles for a single floating icon or a fancy hero banner transition, use CSS Modules.
Use Netlify for web applications and static websites, it handles both CI and deployment for free, which is awesome.
Use Sentry to monitor errors and centralized stacktrace in production.
Drop us a message if you need any helps from the DwarvesLet's build