Fatma Ali
Oct 13, 2021

It's really a personal preference because of two reasons:

1) Ease of change: We can change useAuth to use a different context in one place, compared to if we called React.useContext several times through out the app
2) Readability, for example rather than saying React.useContext(AuthContext), we could just say useAuth(), which is less verbose.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Fatma Ali
Fatma Ali

Written by Fatma Ali

Software Engineer, passionate about code, food & art. Bollywood dancer sometimes💃 Find me on GitHub https://github.com/fatmali

Responses (1)

Write a response