Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const [picture,setPicture] = useState('')
- const [pictureUrl,setPictureUrl] = useState('')
- // handle picture display
- const displayPicture = (e) => {
- let reader = new FileReader();
- let file = e.target.files[0]
- reader.onloadend = ()=> {
- setPicture(file)
- setPictureUrl(reader.result)
- }
- if (file){
- reader.readAsDataURL(file);
- }
- };
- const sendPicture = ()=> {
- storage.child(`cooker/cookerBusinessImages/${new Date().getTime()}`).put(picture).then(console.log)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement