Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

upload text file react js functional component

let files = document.querySelector('input[type="file"]').files;
    const reader = new FileReader();
    reader.onload = () => {
      const lines = reader.result;
      setText(lines);
    };
    reader.readAsText(files[0]);
};
Source by www.textbotonline.com #
 
PREVIOUS NEXT
Tagged: #upload #text #file #react #js #functional #component
ADD COMMENT
Topic
Name
3+8 =