Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const show_image = () => {
- let reader = new FileReader();
- // Closure to capture the file information.
- reader.onload = (function() {
- return function(e) {
- // Render thumbnail.
- image_canvas.current.src = e.target.result
- image_canvas.current.style.display = "block"
- };
- })(selected_file);
- // Read in the image file as a data URL.
- reader.readAsDataURL(selected_file);
- }
Add Comment
Please, Sign In to add comment