Fork me on GitHub

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:


@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?


do you use boot normally or leiningen?


I did some reagent with boot but in my daily job doing clojure with leiningen


but consider me not having knowledge in any of these


@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.


but overall i think re-natal seems like the way to go. there's a bit of discussion from a few days ago in the chat history of this channel.


cool thanks


sounds like difficult to make a clear decision but I will than probably start with re-natal