React + Typescript: Best Practices and Bad Practices

By James Ashok R

Elevator Pitch

After years or decades of facing challenges with the ancestral technologies, we evolve our technologies along with a set of good practices to follow, so that we do not start from scratch. But is just best practices enough?

A knowledge of what to do is good + A knowledge of what not to do is great!

Description

React + Typescript: Typescript adds more of a stricter environment for our development. It eliminates the careless errors that might creep in with the sweet and lenient Javascript. But it is just one single step to a better code quality.

The road to better coding has no end, and every step in the path enriches our code and application, and also makes us into better engineer, trains us with the upcoming challenges. Following best practices keeps our application in safe health. But we do waste more time in experimenting with some codes and logic only to find it never works or it costs us heavily in performance. So, it is good to follow best practices; and an added knowledge of bad practices, of what not to do is essential to reduce wastage of our efforts, to improve efficiency in our application development.

In this presentation I will cover the best practices to follow and bad practices to avoid, and that which ultimately will lead to an optimised application performance.

Notes

Technical Requirements: ReactJS - latest version Typescript - to make effective use of strict type checking The regular stuffs, like a React environment (node, npm, cli, create-react-app,…), VS Code

I have done lots of performance upgrades and refactoring for Angular and React apps; and I have also trained a bunch of my colleagues in the technologies, so I have a good knowledge from experience in Best vs Bad practices of React that could jump start beginners and remind experts to always strive to improve the code better.

A solid foundation of what to do and what not to do, will help create a better web, and surely will make the lives easy for our code’s future maintainers.