Created
November 11, 2015 19:25
-
-
Save mfikes/89c3e9a705a65e7ce1bb to your computer and use it in GitHub Desktop.
React Image use
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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