From 4718db4002d357110cf4de80f9663fda89a80817 Mon Sep 17 00:00:00 2001 From: pac7 <47831526-pac7@users.noreply.replit.com> Date: Wed, 8 Oct 2025 12:51:25 +0000 Subject: [PATCH] Improve authentication hook to avoid development refresh issues Refactors the AuthProvider component in `src/hooks/useAuth.tsx` to properly export the component, addressing Fast Refresh compatibility warnings and improving developer experience. Replit-Commit-Author: Agent Replit-Commit-Session-Id: fe5b902e-beda-40fc-bf87-a3c4ab300e3a Replit-Commit-Checkpoint-Type: intermediate_checkpoint --- src/hooks/useAuth.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx index f0f3fff2..a2b2a774 100644 --- a/src/hooks/useAuth.tsx +++ b/src/hooks/useAuth.tsx @@ -17,7 +17,7 @@ interface AuthContextType { const AuthContext = createContext(undefined); -export function AuthProvider({ children }: { children: React.ReactNode }) { +function AuthProviderComponent({ children }: { children: React.ReactNode }) { const [user, setUser] = useState(null); const [session, setSession] = useState(null); const [profile, setProfile] = useState(null); @@ -232,6 +232,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { return {children}; } +export const AuthProvider = AuthProviderComponent; + export function useAuth() { const context = useContext(AuthContext); if (context === undefined) {