React project – Devstyler.io https://devstyler.io News for developers from tech to lifestyle Fri, 02 Apr 2021 08:11:52 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Here are some tips for typing React components with TypeScript https://devstyler.io/blog/2021/04/01/here-are-some-tips-for-typing-react-components-with-typescript/ Thu, 01 Apr 2021 11:53:17 +0000 https://devstyler.io/?p=46882 ...]]> In his article Maciek Wątroba, a software engineer shared how much he loves TypeScript. He considers it to be a best practice when setting up a new React project.

“It is a great tool for improving developers’ productivity and avoiding some bugs. Getting started is easy, both create-react-app and nextjs come with built-in support.”

Just because of that he decided to demonstrate some techniques that we can use in our day to day work with TypeScript and React. Some of the things that Maciek covered are:

  • Use union types

  • Do not repeat yourself

  • Use generics

If you want you can read the whole article from here.

]]>