DEV Community

Discussion on: File upload with React, Express and Google Cloud Storage with folder structure

Collapse
 
vijajsoninoetic profile image
vijaj-soni-Noetic

const [imgCollection, setImgCollection] = useState('')
const [client, setClient] = useState('')
const [section, setSection] = useState('Section')

const onFileChange = (files) => {
    let items = files.map(fileItem => fileItem.file)
    setImgCollection([...imgCollection, items])
}

where i use these line of code its given me error

Collapse
 
idiglove profile image
Faith Morante

Hello,

What error do you get? Note, I'm using React Hooks.