Fork me on GitHub
#cljsrn
<
2016-03-18
>
stepugnetti10:03:29

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”}])

stepugnetti10:03:02

This is not working for me...

daveliepmann10:03:04

that looks right to me but I haven't tried it

stepugnetti10:03:38

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.

daveliepmann14:03:34

@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

stepugnetti14:03:24

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

knotschi16:03:50

I will soon start with some cljsrn with reagent. should I start with boot-react-native or re-natal? recommendations? pro-cons?

adamfrey16:03:28

do you use boot normally or leiningen?

knotschi16:03:54

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

knotschi16:03:29

but consider me not having knowledge in any of these

aiba16:03:45

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

aiba16:03:31

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.

aiba16:03:00

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.

knotschi17:03:38

cool thanks

knotschi17:03:58

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