helix

https://github.com/Lokeh/helix
Aron 2020-04-21T17:33:50.308500Z

so it turns out I focused so much on cljs, I forgot react. Obviously, if I want to do an effect, like talking to a remote api, I should wrap the code in a use-effect, not just write it in a component.

Aron 2020-04-21T17:35:35.309400Z

otoh, I tried to write my components in a file and use them from another file and it seems that defnc is not enough for it to be usable?

Aron 2020-04-21T17:36:14.310Z

components.cljs has (defnc CompA ...) and I tried to refer to it from app.cljs

Aron 2020-04-21T17:36:38.310600Z

To be sure I created a var in components.cljs with (def) and that I could see fine.

Aron 2020-04-21T17:54:44.311200Z

ok, so I think the new file had so many errors that it broke after the var declaration, that's why the :refer didn't work

Aron 2020-04-21T20:04:38.311900Z

heh, I just realized that at least one component I created with defn not with defnc and it still worked fine.

lilactown 2020-04-21T20:06:21.313200Z

defnc doesn’t really do a whole lot

lilactown 2020-04-21T20:06:52.313900Z

it basically does when defn does but wraps the props argument into something you can destructure easily

Aron 2020-04-21T20:17:29.314400Z

yeah, and this particular component haven't had any props 🙂