DEV Community

Cover image for Getting started with Typescript with React Hooks

Getting started with Typescript with React Hooks

RiyaNegi on June 23, 2021

Typescript is the next big thing in the Front End Development domain and if you are looking to upgrade your skills from a junior to an intermediate...
Collapse
 
ehsan profile image
Ehsan Azizi • Edited

As a side note using React.FC/React.FunctionComponent types to declare functional React components is discouraged for the reasons mentioned here and here

Collapse
 
riyanegi profile image
RiyaNegi

Will check it out thanks!

Collapse
 
amaben2020 profile image
amaben2020

Great job. How do I get an array value from an array in typescript? It gives me an error whenever I do this? I really want to modify my state based on the values from that array. Thanks.

Collapse
 
riyanegi profile image
RiyaNegi

I found this stackoverflow answer helpful, Do check it out
!Link

Collapse
 
amaben2020 profile image
amaben2020

Thanks for your reply. I later filtered and mapped the array before applying the .length () to extract the numbers of items and sort data in that category programmatically.

Collapse
 
alexandrefuente profile image
alexandrefuente

Awesome article, thanks for share.

Collapse
 
andemosa profile image
Anderson Osayerie

I found this article helpful, I am going to be using typescript more in my react projects

Collapse
 
riyanegi profile image
RiyaNegi

I am glad the article was helpful :)

Collapse
 
ponikar profile image
Ponikar

Nice one!

Collapse
 
riyanegi profile image
RiyaNegi

Thanks! :)

Collapse
 
nihatbabazade_ profile image
Nihat Babazadə

Amazing post!

Collapse
 
shakyapeiris profile image
Shakya Peiris

correction typescript is a superscript of javascript

Collapse
 
riyanegi profile image
RiyaNegi

Aaah right! nice catch thanks!

Collapse
 
whales2333 profile image
whales233

thanks! from rick!

Collapse
 
dhaiwat10 profile image
Dhaiwat Pandya

This is a brilliant article Riya 👌🔥

Collapse
 
riyanegi profile image
RiyaNegi

Thanks!

Collapse
 
swagwik profile image
Sattwik Sahu

Just a small change; Instead of adding an onClick listener on the button, you could add an onSubmit listener to the form

Collapse
 
riyanegi profile image
RiyaNegi

Yes right that's the better option!

Collapse
 
rid1 profile image
Ridwan

Thanks, It helps

Collapse
 
riyanegi profile image
RiyaNegi

Thanks! :)