16 lines
425 B
JavaScript
16 lines
425 B
JavaScript
import * as React from "react";
|
|
|
|
export const AuthenticationContext = React.createContext(
|
|
{}
|
|
);
|
|
|
|
export function withAuthenticationContext(Component) {
|
|
return function AuthenticationContextComponent(props) {
|
|
return (
|
|
<AuthenticationContext.Consumer>
|
|
{authenticationContext => <Component {...props} authenticationContext={authenticationContext} />}
|
|
</AuthenticationContext.Consumer>
|
|
);
|
|
};
|
|
}
|