Fork me on GitHub
#reagent
<
2015-08-20
>
tel00:08:35

Is there a lib function somewhere for making it easy to write reagent components which accept optional attr maps?

tel00:08:51

kind of feels like there ought to be….

gadfly36100:08:29

When making components, I typically pass a single map as an argument and destructure it using :keys. if I want certain keys to be optional, I use the :or keyword and set a default value.

tel00:08:41

how do you pass children?

tel00:08:10

or rather, how do you use such a map and have children (@gadfly361)

gadfly36105:08:20

@tel ahh yeah, I have been making 'terminal' components without children, so like an input component or a select component etc, without any nesting. If I were to have children, id look more closely at re-com library for inspiration.

tel05:08:56

there we are

tel05:08:50

I will be reviewing that extensively!

gadfly36105:08:47

In the readme there is a link to a demo page, which is amazing

gadfly36105:08:55

If you're using re-frame, then you can quickly add re-com with the re-frame template: lein new re-frame <app name> +re-com

tel05:08:23

I’ll just have to use it for inspiration I think

tel05:08:45

that’ll be really helpful though, thanks for the link!

coyotespike18:08:16

Has anyone here tried using the Bubbletree.js library? https://vis4.net/blog/posts/tutorial-bubble-tree/

coyotespike18:08:10

It's beautiful and simple.

coyotespike18:08:58

But right now, whenever I include the vis4.jsfile, my console displays TypeError: type.toUpperCase is not a function.

coyotespike18:08:39

And my app won't render. I think this is an error React displays when a module isn't exported properly, or something. I'm not sure of the best way to fix that here.

coyotespike18:08:01

I'll correct myself already - I went to reproduce the error in a minimal repo, but the error didn't appear! So it's not running up against Reagent itself - it's some other conflict. I'll keep tracking it down.