mirror of
https://github.com/morten-olsen/parcel.git
synced 2026-02-08 01:36:24 +01:00
update
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user