<AuthContext.Consumer>
{({ isLoggedIn } => {
return (<div> {isLoggedIn && <span>i'm logged in</span>} </div>)
})}
</AuthContext.Consumer>
with useContext, you can do const { isLoggedIn } = useContext(AuthContext);
and then use {isLoggedIn && ...}
to condtionally render anywhere in the body of your component without all the Context.Consumer business.
[0] https://imgur.com/we-should-improve-society-somewhat-T6abwxn