ReactJS
1import React from "react";
2import {useUserData} from "../../hooks/useUserData";
3
4export interface IUserContextData {
5name?: string;
6iconImg?: string;
7}
8
9export const userContext = React.createContext<IUserContextData>({});
10
11export function UserContextProvider({children} : {children: React.ReactNode}){
12const [data] = useUserData();
13
14return (<userContext.Provider value={data}>
15{children}
16</userContext.Provider>)
17}