Skip to content

Commit

Permalink
rename provider data
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Jul 11, 2022
1 parent 56265f3 commit 267d74b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/providers/ExampleProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { createContext, useContext, useMemo, useState } from 'react';
import { WithChildren } from 'utils';

interface ProviderData {
interface ProviderContextData {
state: string;
setState: (arg: string) => void;
}

const ProviderContext = createContext<ProviderData>({} as ProviderData);
const ProviderContext = createContext<ProviderContextData>(
{} as ProviderContextData,
);

const ExampleProvider: React.FC<WithChildren> = ({ children }) => {
const [state, setState] = useState('');
Expand All @@ -20,7 +22,7 @@ const ExampleProvider: React.FC<WithChildren> = ({ children }) => {
);
};

const useExampleProvider = (): ProviderData => {
const useExampleProvider = (): ProviderContextData => {
return useContext(ProviderContext);
};

Expand Down

0 comments on commit 267d74b

Please sign in to comment.