ANN: Cloact is now Reagent 0.2.0

134 views
Skip to first unread message

Dan Holmsand

unread,
Jan 24, 2014, 7:52:39 AM1/24/14
to clojur...@googlegroups.com, clo...@googlegroups.com
Cloact, a minimalistic interface between React.js and ClojureScript, is now called Reagent (the old name was bad in all sorts of ways).

There is also a new little demo of how to implement undo for Reagent components here:

http://holmsand.github.io/reagent/news/cloact-reagent-undo-demo.html

The new project page is here:

https://github.com/holmsand/reagent

Cheers,

/dan

ritchie turner

unread,
Jan 24, 2014, 9:53:50 AM1/24/14
to clojur...@googlegroups.com, clo...@googlegroups.com

I've started to use reagent, I like how simple it is.

Thanks!

R

ritchie turner

unread,
Jan 24, 2014, 10:32:04 AM1/24/14
to clojur...@googlegroups.com, clo...@googlegroups.com

Hi

Thanks for this library, i like the simplicity.

One issue, I'm trying to add a non standard attr during rendering but it's being dropped, is that a bug or a feature :) ?

Specifically trying to add prod-code to the img tag, doesn't turn up in output


[:img.action {:src "/images/basket.png"
:title "Add to basket"
:on-click add-to-basket
:prod-code code
}]
]

Thanks

R

On Friday, January 24, 2014 9:52:39 AM UTC-3, Dan Holmsand wrote:

Shashy Dass

unread,
Jan 24, 2014, 11:16:15 AM1/24/14
to clojur...@googlegroups.com, clo...@googlegroups.com
Thanks for a great library and the fantastic documentation too.
Reagent is fantastic.

Shashy

Dan Holmsand

unread,
Jan 24, 2014, 11:25:04 AM1/24/14
to clojur...@googlegroups.com, clo...@googlegroups.com

On 24 jan 2014, at 16:32, ritchie turner <black...@gmail.com> wrote:
> Thanks for this library, i like the simplicity.
>
> One issue, I'm trying to add a non standard attr during rendering but it's being dropped, is that a bug or a feature :) ?

Thanks!

Turns out its both bug and feature...

Non standard attributes are not allowed by React itself, so that is a feature. :)

But you *should* be able to add attributes starting with data- and aria-, but that turns out to be broken in Reagent currently. I've added an issue for that here:

https://github.com/holmsand/reagent/issues/6

As a workaround, you could always set the attribute manually, for example like this:

(defn img-wrap [props]
[:img props])

(def prod-code-img
(with-meta img-wrap
{:component-did-mount
(fn [this]
(.setAttribute (reagent/dom-node this)
"prod-code"
(:prod-code (reagent/props this))))}))

and then use prod-code-img like this:

[prod-code-img {:prod-code "foo" :src "bar"}]

/dan

David Nolen

unread,
Jan 24, 2014, 7:18:08 PM1/24/14
to clojur...@googlegroups.com
Great stuff! :)



--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Dan Holmsand

unread,
Jan 25, 2014, 2:56:09 AM1/25/14
to clojur...@googlegroups.com
Thanks! :)

/dan

You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/r1rX_ZA3-lA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages