Hi all, It's been almost 4 years when React team has been released hooks, the addition to React function component to use state and control the mounting of the apps via Effects lifecycle method. In this guide you'll have a practical guide how to use ...

Markdown supported · ⌘↵ to post
Hiep Tran
Software Developer
Hi there, Thank you for your content, I've learned a lot from your post. However, I see you make some mistakes during using auth context. First, you created auth context in
src/auth/AuthContext.tsbut you imported the context from./auth/Contextinstead of./auth/AuthContext. The second problem I saw in your code that AuthContext may be undefined, we should use optional chaining to avoidObject is possibly 'undefined'error.