1const onChange = (event) => {
2 const value = event.target.value;
3
4 // this will return C:\fakepath\somefile.ext
5 console.log(value);
6
7 const files = event.target.files;
8
9 //this will return an ARRAY of File object
10 console.log(files);
11}
12
13return (
14 <input type="file" onChange={onChange} />
15)
16/* Found from Stack Overflow */
1const onChange = (event) => {
2 const value = event.target.value;
3
4 // this will return C:\fakepath\somefile.ext
5 console.log(value);
6
7 const files = event.target.files;
8
9 //this will return an ARRAY of File object
10 console.log(files);
11}
12
13return (
14 <input type="file" onChange={onChange} />
15)
16/* Found from Stack Overflow */
17