'How to upload images one by one to server in react

I want to upload 4 images one by one to server, in response i will get 4 urls and save all urls in a state in react

const multiStatement= async(e) => {
     const files = e.target.files;
     const fd = new FormData()

    files.map(img=>{
     fd.append(`file`, img)
    const res = axios.post(url,fd)

    console.log( res.data.url)//save this url 
   })
}
<input type="file" id="file" multiple name="file" onChange={multiStatement} />


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source