Answers for "how to upload images in react from desktop"

1

how to upload image in react js

import FileBase64 from "react-file-base64";
// FileBase64 <- use as component

<FileBase64 
	type="file"
    multiple={false} <- if want to upload multiple images set "true"
    onDone={} <- take callback function
/>

// onDone return an object of: filename, fileType, base64 data
// use the setState or function of useState to grap the base64 data
Posted by: Guest on September-28-2021
5

react image upload

/* Answer to: "react image upload" */

/*
  "react-images-upload" is a simple component for upload and
  validate (client side) images with preview built with React.js.
  This package use "react-flip-move [1]" for animate the file preview
  images.
  
  Download it here:
  https://www.npmjs.com/package/react-images-upload
  
  or if you need help or don't want to use packages,
  you can watch this video:
  https://www.youtube.com/watch?v=XeiOnkEI7XI

  [1] Link to "react-flip-move", mentioned in the 
  "react-images-upload" summary:
  https://github.com/joshwcomeau/react-flip-move
*/
Posted by: Guest on April-17-2020

Code answers related to "how to upload images in react from desktop"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language