Skip to content

Instantly share code, notes, and snippets.

@loraxx753
Last active July 9, 2018 02:27
Show Gist options
  • Save loraxx753/aa0596fd44d367dce851d816b033587e to your computer and use it in GitHub Desktop.
Save loraxx753/aa0596fd44d367dce851d816b033587e to your computer and use it in GitHub Desktop.
import React from "react";
import firebase from "../firebase.js";
const FiebasePromise = props => firebase
.storage()
.ref()
.child("images/" + props.imageName)
.getDownloadURL()
};
// And it would be used like this:
const Example = props => (
<FiebasePromise imageName={'IdunnoWhatever.jpg'}>
{(url) => <p>The url is {url}</p>}
</FirebasePromise>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment