You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
349 B
JavaScript

import React, {useContext} from 'react'
const UserContext = React.createContext(null);
export const UserContextProvider = UserContext.Provider;
export default function useUser(){
const [user, setUser] = useContext(UserContext)
return user
}
export function useSetUser() {
const [user, setUser] = useContext(UserContext)
return setUser
}