mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
26 lines
423 B
TypeScript
26 lines
423 B
TypeScript
import React, { createContext } from 'react';
|
|
|
|
declare var data: any;
|
|
|
|
interface GithubContextType {
|
|
username: string;
|
|
keys?: string[];
|
|
}
|
|
|
|
const GithubContext = createContext<GithubContextType>(data);
|
|
const GithubProvider: React.FC = ({
|
|
children,
|
|
}) => (
|
|
<GithubContext.Provider
|
|
value={{ ...data }}
|
|
>
|
|
{children}
|
|
</GithubContext.Provider>
|
|
);
|
|
|
|
export {
|
|
GithubProvider,
|
|
};
|
|
|
|
export default GithubContext;
|