Organization of Authentication State in React Apps

Share this video with your friends

Send Tweet

Authentication state is one of the things that can really twist up our application's components with a bunch of if statements for handling that state. But there's a simple trick you can apply to reduce the complexity of your components.

This is based on my blog post: Authentication in React Applications

Kai
Kai
~ 3 years ago

This may work fine in this example, but in the real world you have component like a header or navigation that contain components that changed based on log in status. (e.g. Login/Logoff, display Profile, etc...). This seems mostly academic to me.