Fork me on GitHub
#cljsrn
<
2021-07-21
>
dnolen15:07:53

@plins check that you can load those files in your browser

dnolen15:07:00

if you cannot - then no way your app will be able to

dnolen15:07:23

if you can, then just run a Metro refresh - sometimes there's a hiccup

dnolen15:07:34

type r in the Metro terminal

dnolen15:07:34

you should not have to mess w/ anything else

dnolen15:07:57

ClojureScript files are fetched through Metro

dnolen15:07:08

if Metro is not working - then nothing is going to work anyway

dnolen15:07:34

(the RN bundle has to be served through Metro)

plins15:07:27

if I press R I get the same results 😕 what is strange to me is that if I run the hello world app created with npx react-native init it works fine, Metro is working and I can hotreload code Im going to double check my configuration and try it on another machine to see if things work out differently, thanks for the assistance everyone 🙂

dnolen15:07:37

like I said I would not look too deeply for answer

dnolen15:07:45

you already know there's something quite contradictory here

dnolen15:07:10

you can load those urls in a browser - but the Metro network request for those files is failing

alexdavis19:07:37

Anyone know what translating this into cljs looks like?

<CountdownCircleTimer>
    {({ remainingTime, animatedColor }) => (
      <Animated.Text style={{ color: animatedColor }}>
        {remainingTime}
      </Animated.Text>
    )}
  </CountdownCircleTimer>
I think it should be
(def text (r/adapt-react-class (.-Text ReactNative)))
(def countdown (r/adapt-react-class CountdownCircleTimer))
[countdown
      (fn [^js props]
        (let [remaining-time (j/get props :remainingTime)
              color (j/get props :animatedColor)]
          (r/reactify-component
           [text
            {:style {:color color}}
            remaining-time])))]
but that doesn't work, I've tried many combinations of things that I think should work but I guess I'm just missing some understanding of reagent and react, possibly react-native works different to react? I also haven't been able to require tick, I think because of some react-native specific issue

dnolen19:07:37

@alex395 I guess that's a weird JSX shorthand instead of inlining the props as attributes?

dnolen19:07:56

I don't think it's specific to RN

dnolen19:07:16

You could probably look at what the JSX translates to, I'm not familiar with that pattern myself

alexdavis19:07:28

Yeah I’ve not seen it before either… I am wondering if its something to do with reagent generating class components and those somehow aren’t compatible with what the CountdownCircleTimer wants, but I feel really out of my depth there 😅 I guess I will ask in #reagent as that seems more appropriate

alexdavis20:07:26

Well looks like I just had to use r/as-element instead of reactify-component, doesn't make much sense to me.. guess I'm seeing the advantages of helix now, gets out of the way and is easier to reason with

👆 2
💯 2