Fork me on GitHub

and this is way to block propagation on some event:


(defn stop-propagation [e]
  (.stopPropagation e))

(defn component []
  [:> Foo {:on-drag stop-propagation}])


Hello, how would one use js interop to change inner html of a reagent div?


[:div {:id "elId"}] (set! (. (. js/document getElementById "elId") -innerHTML) "<b>Bold!</b>")


this does not seem to work


cheers thanks allot


how can I understand what [:> exactly expands into. is it same as (reagent/create-class { so I can write [:> :reagent-render [:hiccup]... and so on?


Section on better interop with native react


@gadfly361 hanks I can see now! so I can override any lifecycle method on adapted class like [:> :component-did-mount or I do have to wrap it into my own class.


I don't think you can do that unfortunately


Only just construction props into here [:> I guess then? :thinking_face:


@gadfly361 an other user @mateusz.probachta advised that `(defn component [] [:> Foo {:on-drag stop-propagation}])` would work and it does on some cases. Right now I am very puzzled. :face_with_monocle:


@faxa i think you are confused because :> is syntactic sugar for adapt-react-class .. not create-class


@faxa according to the link above it is sugar for [(adapt-react-class ReactComponent) props]. it has no documentation other than that single paragraph and it is basically impossible to search for, so i’d stick with adapt-react-class if i were you 🙂


i can’t even find its definition in the code


The case where pos = 0


@mikerod ahh! that’s why i couldn’t find it 🙂


Yeah, the keyword is translated to a string via name which removes the : char, so you don’t end up finding the :> in the code via a search


Well, it is in the comment there I guess hah


i found comment before but i didn’t read carefully enough to realize that this was actually implementing it. i was expecting it to be defined like a normal reagent function/component. it is interesting that it is special cased right into the parsing code


Yeah, I’m not sure on exactly why other than that is where it needs to handle the native components vs reagent fn style components


so the :> it isn’t exactly the same as adapt-react-class. :> basically creates an instance of the react component directly, as far as i can tell, whereas adapt-react-class takes the react component and constructs a deftype NativeWrapper from the component. i don’t quite understand if there is any practical difference, though


actually ignore the previous comment. they both end up as calls to (native-element #js{:name comp} ...)


@lee.justin.m They are nearly the same thing it seems from the impl. I once thought that there was some sort of runtime performance advantage of using adapt-react-class instead of the inline :> style. However, it isn’t looking much different when looking at the implementation. I could be missing something though.


yea i don’t think so either. except for the call to adapt-react-class itself, which is trivial, I’m pretty sure there is no difference


@mikerod do you know who “owns” this project? there is a lot of great documentation on reagent, but I’m trying to understand why it isn’t making its way back into the github project.


I don’t know.

mikerod18:02:15 gives some guesses, but that’s it for what I know.


i looked at that before. i have this sneaking suspicion that the problem is that this thing is Dan Holmsand’s baby, but he isn’t super involved any more, so now nobody really feels like they own it anymore


It has had quite a bit of activity on the 0.8 stuff. Seems to be pretty active.


yea but not by holmsand, who appears to have written most of it


Yeah, perhaps a change of owners. Idk


@lee.justin.m there is truth to Dan being less involved, but the project is being looked after largely by @juhoteperi these days (and also @yogthos @mikethompson)


I'm currently mostly interested about technical improvements (better test runners, getting 0.8 out & improving ClojureScript JS module support), so I haven't mostly looked into updating site or docs


The Re-frame Reagent docs are probably mostly written by @mikethompson? If there is benefit in maintaining them on Reagent repo it should be easy to copy them to wiki, or add to docs folder, which we could later publish as site


If I understand correctly, re-frame wiki docs (where reagent docs are) are legacy and docs/ folder is the new docs?


And if someone is interested in contributing to docs and site, I can accept such pull requests quickly (i.e. no release, no changes to lib code)


I might have some time in the coming weeks (i.e., end of February) to take a stab at helping with documentation


the things I would like to see, and will help with if desired: [1] install a “guide” tab at the top of right next to the “intro” tab that looks something like this [2] fill out the api docs, which are woefully incomplete. [3] go through the news releases and incorporate every precious nugget of information in there in either the guide or the api, [4] write an interop guide


I haven't done much work on reagent itself, but I do maintain the templates for it


hey all, check out this super cool and fantastic reagent + re-frame project that I made!


@juhoteperi I'd be very happy to move my various docs across in reagent's /docs. I feel it should have happened already.


I think we have to take a "make small wins" approach to the docs.


Those three new documents you see used to be in the re-frame Wiki, but they have now been removed from the Wiki and redirected to their new equivalent.