img tag not reading url which is passed in src reactJS

I’m recieving my img url from my DB like this

const [img,setImg] = useState()

 useEffect((): void => {
    .then((users) => {
    .catch((err) => {
      console.log('--------err', err);


After this i setImg to the img like this :

 useEffect (() : void => {
console.log('--------img', img);

When i console.log(img) i get url like this file:///home/user/Desktop/sql/uploads/avatar-1594717135245.jpeg.gif .When I copy it and paste it to the broswer I get img which shall be displayed,so URL Is correct.

Here is my img tag : <img ref={fileRef} src={img} width={'400'} alt={'picture'}/> it is showing no errors in the console but the problem is it is not displaying the picture either. Any suggestions please?