Reusing logic in React has been complex, and patterns like HOCs and Render Props tried to solve that problem. With the recent addition of Hooks, re...
For further actions, you may consider blocking this person and/or reporting abuse
"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.
Nice work
Thank you for this, this really saved me. Very well written, and link too a GitHub repo also makes this worth vile.
Thank you, Camilo.
It was a fun & educational article as you provided best practices as well.
Beware of this pattern, once Suspense for data fetching is out (soon) this pattern will be obsolete.
You're right, but if you need to start a project just now and can't wait until suspense for data fetching is out, this is still valid.