This commit is contained in:
2020-08-22 11:35:29 +02:00
parent a37d5f8845
commit 12c3383b55
3 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import React, { createContext } from 'react';
const data = require('../../data.json');
console.log('d', data);
interface GithubContextType {
username: string;
@@ -8,7 +9,15 @@ interface GithubContextType {
}
const GithubContext = createContext<GithubContextType>(data);
const GithubProvider = GithubContext.Provider;
const GithubProvider: React.FC = ({
children,
}) => (
<GithubContext.Provider
value={{ data }}
>
{children}
</GithubContext.Provider>
);
export {
GithubProvider,