helix 2021-05-23

I’m struggling to make re-frame work with Helix. The subscription works, but the dispatch and / or reloading the component when the event is triggered doesn’t seem to be working. Here’s the code, can anyone figure out what I’m doing wrong?

(defnc TabA [_] {:helix/features {:fast-refresh true}}
       ($ rn/View {:style (j/lit {:flex 1, :alignItems "center", :justifyContent "center"})}
          ($ rn/Text {:style (j/lit {:fontSize 36})}
             (str "clicked " @(rf/subscribe [:get-counter])))
          ($ rn/TouchableOpacity {:style    (:button styles)
                                  :on-press #(rf/dispatch [:inc-counter])}
             ($ rn/Text {:style (j/lit {:fontSize 36})} "Click here"))))

As far as I know, reframe is very specifically tied to reagent and you will have a really hard time using it with anything else.

Looks like not fully fleshed out. But gives an idea on what will be required. Some sort of custom hook to subscribe to the r/atom. If you are not super experienced with this stuff, I'd personally recommend against the combination unless this is just a for fun project 🙂

Thanks - will look into that guide (even though it does look incomplete).

oh, awesome - will try that. Thanks!