Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created November 11, 2015 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/89c3e9a705a65e7ce1bb to your computer and use it in GitHub Desktop.
Save mfikes/89c3e9a705a65e7ce1bb to your computer and use it in GitHub Desktop.
React Image use
(defn image [opts & children]
(apply js/React.createElement js/React.Image (clj->js opts) children))
(def image-url "https://upload.wikimedia.org/wikipedia/en/b/b5/Seuss-cat-hat.gif")
;; Deep in my view hierarchy
(image {:style {:borderColor background-color
:borderWidth 10
:width (/ 329 2)
:height (/ 475 2)}
:source {:uri image-url}} nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment