DEV Community

Joe
Joe

Posted on

component #1 - Carousel

What I have learned?

  • How to useState.
    Coding with react for several months and dealing with classes I now find that using state inside a function is just amazing. 😌

  • How to useEffect.
    Handling side effects inside the useEffect and clean up when necessary.
    And telling to that effect when and when not to run to optimize the performance. This is made possible by passing the second argument for useEffect.

  • Using keys to have a unique element or component.
    Before I thought that keys are only meant for making a unique item when mapping a list to remove the intimidating warning message from console.

What are the main challenges?

As I develop this component I'm kinda doubtful for each solution that I'm going to try, knowing that it has the chance to solve the problem. I still get very uncomfortable doing it.

Why am I doing this anyway?

  • To learn.
  • To have fun.
  • To future Joimee (for reference).

Resources:
React Today and Tomorrow and 90% Cleaner React With Hooks
Hooks Reference

Salamat.

Oldest comments (2)

Collapse
 
aut0poietic profile image
Jer

Nice. I'm still working up the nerve to share my stupid stuff. ;-)

Keep it up, yo!

Collapse
 
oieeaaaa profile image
Joe

I'm looking forward to that Jer. Thanks!