hello i try to 'import image from ../img/number_of_my_user_id.png' how to do this please ?
my code is :
import React, { useState, useEffect } from 'react'
//i want to something like this
import Image from `../image/${userid}.png`
const [userid, setUserid] = useState(null);
const userConnected = useEffect(() => {
(async () => {
try {
const resp = await
httpClient.get("//localhost:5000/@me");
setUserid(resp.data.id);
} catch (error) {
console.log("Not authenticated");
}
})();
}, []);
please i really need help, my question is, how can i import an image whose name deppending to user Logged in ?
i don't know how can i import my user Image....