Authentication is hard! Nowadays, to create a simple login or logout feature, we require a considerable amount of boilerplate code. Now picture we want to add authentication with Google or Facebook? More boilerplate, right?
What if I told you that in React you can do that just by wrapping your code with a context provider and by using a custom react hook?
In this blog post, I’ll show you how to add authentication to your React application using the Auth0
useAuth0 custom hook, how to display the authenticated user information, and how to authenticate with a social provider like GitHub.
Hey everyone, I’m making this post to share with you a library that made managing server state on React applications easy and fun — React Query.
In this blog post, I’ll do a small introduction by explaining what led to its creation followed by an introduction to how the
useQuery hook works. I’ll end this post by showing some custom configurations we can do, and how we can do cache invalidation, data refetching, and optimistic updates.
Until now, many React applications have been relying on global state as a way to share data between components and avoid prop drilling.
Despite this apparent advantage, global data is often poorly used, and often is used without thinking if what we are adding there should be global to our application. Another thing that often happens is mixing server state with the client state. So what is the difference between client state and server state? …
More than a year has passed since the release of React Hooks. By now, we know all the basics and perhaps have our apps using one or two of them.
This post consists of an agglomerate of tips and pains suffered while trying to migrate from a full-fledged pre Hooks app to a Hooks using one.
At the time it seemed a controversial decision. …