Introduced in React 16.8, Hooks are a new way to write stateful components while avoiding the pitfalls of classes.
As a result, GraphQL developers everywhere wanted to use them for their Apollo Client components, instead of relying on render props pattern. In August of 2019 things have changed and Apollo Client now has official support for React hooks, by providing useQuery
, useLazyQuery
, useMutation
and useSubscription
hooks.
If you'd like to learn how to use them, this playlist is for you!
Frontend Engineer at Stedi, building Cloudash. His interests include React, AWS, testing, Svelte, VR, app performance and... jQuery, which he still thinks is the best library ever.