Skip to content

Commit

Permalink
수정: 명확한 변수명으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
lshyun955 committed Jan 3, 2025
1 parent 4e8a651 commit 878597e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 2 additions & 4 deletions src/context/Auth/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
addNotification("로그아웃되었습니다", "info");
}, [addNotification]);

const authInfo: AuthContextType = useMemo(() => {
const value: AuthContextType = useMemo(() => {
return {
user,
login,
logout,
};
}, [user, login, logout]);

return (
<AuthContext.Provider value={authInfo}>{children}</AuthContext.Provider>
);
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
};
6 changes: 2 additions & 4 deletions src/context/Item/ItemContex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ export const ItemProvider = ({ children }: { children: React.ReactNode }) => {
]);
};

const itemInfo: ItemContextType = {
const value: ItemContextType = {
items,
addItems,
};
return (
<ItemContext.Provider value={itemInfo}>{children}</ItemContext.Provider>
);
return <ItemContext.Provider value={value}>{children}</ItemContext.Provider>;
};
9 changes: 6 additions & 3 deletions src/context/Theme/ThemeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
const CurrentTheme = theme === "light" ? "dark" : "light";
setTheme(CurrentTheme);
};

const value: ThemeContextType = {
theme,
toggleTheme,
};
return (
<ThemeContext.Provider value={{ theme, toggleTheme }}>
{children}
</ThemeContext.Provider>
<ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
);
};

0 comments on commit 878597e

Please sign in to comment.