WordClockESP/interface/src/authentication/Context.js

16 lines
425 B
JavaScript
Raw Normal View History

2019-05-14 21:47:04 +00:00
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>
);
};
}