Fork me on GitHub
#reagent
<
2016-03-13
>
pez10:03:13

To whomever who cares: I just updated my blog post on Reagent clientside routing using Bidi and Accountant to use multimethods for the dispatching: https://pez.github.io/2016/03/01/Reagent-clientside-routing-with-Bidi-and-Accountant.html

lsenta12:03:34

Hey guys, I have a bug with reagent, svg markers do not work?

nidu13:03:32

@lsenta: Probably React just doesn't support it. Did you look at https://facebook.github.io/react/docs/tags-and-attributes.html ?

juhoteperi16:03:26

React 0.14 supports additional SVG attributes and tags, not sure if that helps. React 0.14 requires Reagent 0.6-alpha.

lsenta17:03:49

@nidu @juhoteperi Thanks guys, that explain what's happening. Weird to learn that react just ignore field it does not know, I need to look at the internals.

lsenta17:03:19

I'm trying to use form-3 components and set my attributes in the component-did-mount to bypass that, see http://stackoverflow.com/questions/31666274/creating-a-line-with-an-arrow-in-react

lsenta17:03:18

Do you have any idea/examples on how to do that? I'm not sure how to retrieve the node in the component-did-mount function

lsenta17:03:33

In SO they do something like:

var markerNode = React.findDOMNode(this.refs.marker)
           var markerEndNode = React.findDOMNode(this.refs.markerEndNode)
What would be the reagent equivalent?

juhoteperi17:03:45

(r/dom-node this)

juhoteperi17:03:50

Reagent doesn't have refs so you need to use normal DOM operations if you need to select children elements (getElementsByTagName or such)

lsenta17:03:33

@juhoteperi That was easy, thanks for the help!

lsenta17:03:52

The fixed version:

lsenta17:03:10

That'll fail if you run it twice, somehow the attributes get lowercased, not sure why

nidu17:03:23

@lsenta: not sure how to do it properly but i just embedded plain html with dangerouslySetInnerHTML. Moreover in my cases svg defs change rarely.

juhoteperi23:03:11

React 15.0.0-rc.1 is now available in Clojars and it should support all SVG tags and attributes. Quick check shows that Reagent app loads okay with it.

juhoteperi23:03:33

I don't have code to check SVG stuff.

cky23:03:48

I should write some (code to check SVG stuff).