20 lines
404 B
TypeScript
20 lines
404 B
TypeScript
|
|
import { SessionContextProvider } from "./SessionContext";
|
||
|
|
|
||
|
|
interface IContext {
|
||
|
|
children: React.ReactNode;
|
||
|
|
}
|
||
|
|
|
||
|
|
function AppContext(props: IContext): any {
|
||
|
|
const { children } = props;
|
||
|
|
const providers = [
|
||
|
|
SessionContextProvider,
|
||
|
|
];
|
||
|
|
const res = providers.reduceRight(
|
||
|
|
(acc, CurrVal) => <CurrVal>{acc as any}</CurrVal>,
|
||
|
|
children,
|
||
|
|
);
|
||
|
|
return res as any;
|
||
|
|
}
|
||
|
|
|
||
|
|
export default AppContext;
|