skip to Main Content

Missing some datas while passing data from child component to parent – Reactjs

I have function in parent component   const getFilename=  (filedata)=>   { console.log(filedata);       } And pass call a child component from parent <FileUpload getFieDetails={getFilename} /> Childcomponent function: const [files, setFiles] = useState([]) const uploadHandler = (event) => {      const file = event.target.files[0];       console.log(file);      if(!file) return;         file.isUploading = true; setFiles((prevState) => [...prevState, file])  props.getFieDetails(files); ) } when i console files from child component…

VIEW QUESTION
Back To Top
Search