관리 메뉴

CASSIE'S BLOG

export 'default' (imported as 'AuthContext') was not found in './context/AuthContext' (possible exports: AuthContextProvider) 본문

PROGRAMMING/React

export 'default' (imported as 'AuthContext') was not found in './context/AuthContext' (possible exports: AuthContextProvider)

ITSCASSIE1107 2023. 8. 19. 15:14

 

 

import React from 'react';

const AuthContext = React.createContext({
    isLoggedIn: false,
    onLogin: (email, password) => {},
    onLogout: () => {

    }
});

export const AuthContextProvider = (props) => {
    return(
        <AuthContext.Provider value={{
            isLoggedIn: isLoggedIn,
            onLogout: logoutHandler,
            onLogin: LoginHandler
        }}>
        {props.children}
       
      </AuthContext.Provider>
    )
};

export default AuthContext

코드를 보니 마지막에   ' ; ' 거를 안 붙여줌.

 

해결하니까 이 에러가 뜸

 

반응형