This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (2)
- # beginners (93)
- # boot (9)
- # cider (1)
- # cljs-dev (50)
- # cljsrn (4)
- # clojure (32)
- # clojure-russia (58)
- # clojure-spec (23)
- # clojurescript (146)
- # clojurewerkz (2)
- # component (1)
- # cursive (2)
- # hoplon (163)
- # off-topic (4)
- # om (117)
- # onyx (8)
- # pedestal (1)
- # re-frame (13)
- # reagent (34)
- # spacemacs (17)
- # test-check (1)
- # untangled (3)
I'm not sure how to do the things you describe, but there are a couple of resources that have helped me out a lot in learning reagent: https://github.com/reagent-project/reagent-cookbook https://github.com/Day8/re-frame/wiki/Creating-Reagent-Components
well...what i'm saying is i already read through the reagent tutorials...and what i'm asking for are just examples wrapping more of the classes from the top-level react.js api rather than using hiccup
it should make sense to people who've used react.js through the api...the problem is most you talk to on the js side have only used jsx, which is a lot like hiccup
i just mean these wrappers for these classes: https://facebook.github.io/react/docs/react-api.html
Ah ok, I don't really have much experience with react itself. I started using reagent without knowing anything about react. The reagent API maybe have some of what you're looking for. Seeing the link you posted there are several functions in reagent.core that seems to fit the bill.
createFactory, i don't see anything that might help there, but react is available in the js global scope (js/React) but that might not be of much help.
well createFactory is really just syntactic sugar that can be replicated with createElement
I had a lot of trouble figuring out stuff too. There is a lot of react resources, articles and the likes, and not that much reagent. So figuring out the interop have taken a fair bit of my time.
But starting with a good understanding of React puts you in a better place to figure it out than I have.
uh...well...presumably you're using reagent in a manner consistent with example projects and tutorials whereas i'm using it consistent with best practices for React.js and i suppose will have to choose whether to read through the source seeing as there don't exist any example projects that use it this way...
I'm sorry I couldn't be of more help. I tend to not touch the top level api very often. Whats been of most help have been learning how to use the lifecycle functions, and then I tend to stick to using pretty basic hiccup and using atoms for state.
really? the tutorials all say to avoid even the lifecycle functions. that i can at least understand since they're a major source of race condition bugs
but making react more like writing markup and less like programming...idk i always saw that as the webmonkey approach
i suppose with atoms you eliminate the need for container components so that's very smart
hmm, I use the lifecycle functions fairly frequently and haven't heard that you shouldn't use them. I'm sure they can be troublesome sometimes. But sometimes I don't see any other way to handle certain problems. Like selecting dom elements when things are mounted and so forth.
I have heard tho that using react to handle state isn't that great of an idea when using reagent.
I feel more often that reagent presents its own paradigm, and I've been sticking to that rather than coaxing reagent to do things the react way.
reagent is the react way...it's just the less sophisticated one where you use jsx instead of the api. better for designers instead of programmers, which is a bizarre choice for clojurescript if you ask me
I don't really see it that way. React is a way to render data to the dom, and clojurescript is all about the data. All the good stuff about clojurescript and a good way to reactivly render your manipulations to the dom.
@gadfly361 does it end up being useful in a way that helps me port a large library of existing react components for easier cljs interop? because otherwise i'd just use them in their js versions
@sophiago no, it doesnt help regarding that issue. Just commenting why clojurescript community might have made that choice to use a jsx-like syntax
and as you mentioned, this isn't really like jsx other than in a systems design sort of way
my choices at the outset are just slightly frustrating is all. like atoms are a clear win vs. container classes
and i'm talking to someone who similarly comes from a react background and decided to use 100% js interop other than atoms, but i don't see the point of that and would really prefer to port my components using your wrappers
I understand your dilemma, unfortunately i have no insight toward a solution (been entirely on the cljs side of the fence). Hope someone is able to chime in that can help tho! :)
i'm just having some frustration over the amount i'm forging my own path compared to how i imagined is all 🙂