SHARE
TWEET

Untitled

a guest Sep 21st, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const [picture,setPicture] = useState('')
  2.     const [pictureUrl,setPictureUrl] = useState('')
  3.  
  4.  
  5.  // handle picture display
  6.     const displayPicture = (e) => {
  7.         let reader = new FileReader();
  8.         let file = e.target.files[0]
  9.         reader.onloadend = ()=> {
  10.             setPicture(file)
  11.             setPictureUrl(reader.result)
  12.         }
  13.         if (file){
  14.             reader.readAsDataURL(file);
  15.         }
  16.     };
  17.  
  18.     const sendPicture = ()=> {
  19.         storage.child(`cooker/cookerBusinessImages/${new Date().getTime()}`).put(picture).then(console.log)
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top