score:1

const {currentuser, } = useauth();
const [imgurl, setimgurl] = usestate([]);

useeffect(() => {
        const fetchdata = async () => {
            const response = await firebase.firestore().collection("users").doc(currentuser.email).get();
            setimgurl(response.imgurl);
        };
        fetchdata();
        }, []);
         return (
            <>
             <img src={imgurl} alt="avatar" class="profile" />
            </>
          )

fetch the doc and then and get the imgurl and set the value to setimgurl state. pass the imgurl to the img tag.


Related Query

More Query from same tag