react-oidc
react-oidc copied to clipboard
Feature: Custom Hook
While this is an easy way to get the "context"
<UserData.Consumer>{context =>
...
</UserData.Consumer>
A hook would make my code easier to read.
const UserProfile = () => {
const context = useUser(); // better name needed
return (....)
}
Thoughts?
Totally agree that we should get some hooks going on!
Sorry, forgot about this feature request.
I'll have sometime next week to send a PR. Looks like a one liner tho.
Example:
export const useStateValue = () => useContext(StateContext);
What do you think is a good name for the function?