Skip to content

GCMO/React_TypeScript-RandomUserAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React_TypeScript-RandomUserAPI

PROJECT:

In this project, we display random users' profile pic, name, dob & city of residence. A very, very minimal

Title Button & UserData
display sandwiched btw & . But cool logic for the button, that fetches data from https://randomuser.me/api .

See the final deployment --> https://gcmo.github.io/React_TypeScript-RandomUserAPI/

OBJECTIVE:

I've been focusing on TypeScript, as next challenge in JavaScript land. With this project, I wanted to challenge my TS skills within React.

LEARNING CURVE:

Typescript within React is pretty straight-fowards:

  • a) Rule of Thumb(ROT) 1: just let it detect the type of a variable according to the value assigned.
  • b) but what about {props} useState, useEffect and events? Welll... you just learn what type should be assigned to them. Best resource for that: https://github.com/typescript-cheatsheets/react#reacttypescript-cheatsheets
  • c) ROT2: use interfaces for each component. Still have to decide whether its more efficient to have all the interfaces in their own file or just associated with their respective component.
  • d) Pay extra attention to API data... mostly doable with interface, but in some cases generics may work better.

CHALLENGES:

props, state,

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published