DEV Community

Discussion on: Coding is like Art.

Collapse
 
scr2em profile image
Mohamed Abdelgwad • Edited

Hi, I like your article xD .
have you tried useSelector hook ?
I believe that using a react functional component with useSelector hook
can save your around 3 or 4 lines of codes, and you won't need the hassle about connect()
also a little tip I use instead of parseInt(number) is +number xD yes I'm lazy

Collapse
 
nmhummel profile image
Natalie Hummel

I will look into that hook, thanks for the tip. I went with ownProps at the recommendation of my instructor. Still working on using hooks with confidence. So instead of parseint you say +number?

Collapse
 
scr2em profile image
Mohamed Abdelgwad

yep, +number converts a string to number