This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-18
Channels
- # admin-announcements (1)
- # aleph (3)
- # beginners (20)
- # boot (9)
- # cider (74)
- # clara (1)
- # cljs-dev (28)
- # cljsrn (15)
- # clojars (32)
- # clojure (149)
- # clojure-dusseldorf (3)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-russia (20)
- # clojure-uk (5)
- # clojurescript (133)
- # core-async (2)
- # cursive (19)
- # datomic (24)
- # devcards (1)
- # funcool (100)
- # hoplon (48)
- # keechma (1)
- # kosmos (7)
- # ldnclj (3)
- # leiningen (3)
- # luminus (16)
- # off-topic (8)
- # om (103)
- # onyx (47)
- # pedestal (3)
- # proton (7)
- # re-frame (13)
- # reagent (11)
- # ring-swagger (1)
- # specter (6)
- # testing (12)
- # untangled (24)
- # yada (32)
Hi all! I would like to use the Image
RN component with the resizeMode
property set to, say, “stretch”. Isn’t it enough to use {:resize-mode “stretch”}
as and option map in the Reagent component? Like:
(def img (adapt-react-class (.-Image (js/require “react-native”))))
(defn stretched-img
[]
[img {:resize-mode “stretch”, :source “whatever”}])
This is not working for me...
that looks right to me but I haven't tried it
It compiles and runs, but the result is not a stretched image. And the same happens with the other modes.. Oh, by the way, I’m using re-natal.
@stepugnetti: this may be late and little consolation, but I'm seeing similar behavior when I test on my side. I tried setting width and height to nil as suggested here, but no dice: https://github.com/facebook/react-native/issues/3686
@daveliepmann: Thanks! I tried setting height and width to nil and the image gets stretched. Apparently having set position “absolute” and all the four values of top, bottom, right, left is also necessary.
I will soon start with some cljsrn with reagent. should I start with boot-react-native or re-natal? recommendations? pro-cons?
@knotschi I recently investigated this same decision. I wanted cljsrn and reagent and was indifferent to lein vs. boot. I recommend re-natal. I had a smoother experience running the example apps with fewer mysterious console errors, people in this chatroom seem to use it so we can come here to support each other, re-natal supports a more recent version of react-native library, supports a newer way of adding static images, and in my tests recompiling+injecting cljs into a running simulator was noticeably faster.
boot-react-native did have some cool things going for it, such as it combined the react-native packager console output into the same terminal as the cljs compiler and other logging messages. boot-react-native also felt lighter weight, for example the hello world example app is 1 cljs file, and the example project had fewer files overall.