Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142075

How to add an extra file instead of resetting ReactJS

$
0
0

So I have this code right now: https://pastebin.com/82wxz8yt which allows users to load mp3 files from their computer to a draggable list using input. This created list looks something like this:

enter image description here

The files are added to the list by selecting the input and using the Promise in the handleClick function to load the files into the files array that is created in the constructor in this.state and then processed through a .map() function and in an editable text input to display each file.name.

My problem is that whenever I click the input again to add a new file the list resets and the old list pretty much gets deleted. My question is how can I add an extra button on the bottom or something that allows me to add extra files to the list without resetting the list?


Viewing all articles
Browse latest Browse all 142075

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>