DEV Community

Discussion on: Fetch data with React Hooks and Typescript

Collapse
 
tksilicon profile image
ThankGod Ukachukwu • Edited

"Inside that function, I'm using the Hook useState to manage the web service states. Note that I need to define the exact type of data that will be managed by the result state passing the generic Starships not Starship. I'm initializing the Hook with the interface ServiceInit of the union type Service, so the only property allowed is status with the string 'loading'."

You initialized with ServiceLoading not ServiceInit and the generic Starships not Starship. I am following your tutorial to solve a challenge so I am following the tutorial closely.