How to reset ReactJS file input

后端 未结 10 1046
傲寒
傲寒 2020-12-29 00:55

I have file upload input:


And I handle upload t

10条回答
  •  -上瘾入骨i
    2020-12-29 01:49

    You can also include this in your input element if you know you are not going to be using the built-in file input value at all.

    
    

    This way the value is always reset to the empty string on render and you don't have to include it awkwardly in an onChange function.

提交回复
热议问题