W
W
wo0dpeker2020-10-16 21:39:25
JavaScript
wo0dpeker, 2020-10-16 21:39:25

How to track file change in input?

In a React application, you need to track any file upload in input. Be it the same file as the previous one or a new one
Tried onChange and onInput but none of them work correctly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xenonhammer, 2020-10-17
@xenonhammer

you can track the files in the input through the file reader. it has events like onload, onerror etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question