This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-09
Channels
- # beginners (55)
- # boot (173)
- # clara (3)
- # cljs-dev (10)
- # cljsjs (3)
- # clojars (11)
- # clojure (110)
- # clojure-austin (5)
- # clojure-berlin (13)
- # clojure-chicago (2)
- # clojure-dusseldorf (3)
- # clojure-france (24)
- # clojure-italy (4)
- # clojure-portugal (1)
- # clojure-russia (60)
- # clojure-serbia (8)
- # clojure-spec (150)
- # clojure-uk (129)
- # clojurescript (87)
- # core-logic (1)
- # cursive (75)
- # datavis (1)
- # datomic (75)
- # devcards (4)
- # dirac (17)
- # emacs (50)
- # events (2)
- # hoplon (9)
- # jobs (4)
- # jobs-discuss (37)
- # lein-figwheel (3)
- # luminus (5)
- # off-topic (54)
- # om (9)
- # om-next (5)
- # onyx (10)
- # perun (11)
- # protorepl (11)
- # quil (2)
- # rdf (2)
- # re-frame (14)
- # reagent (58)
- # ring (13)
- # ring-swagger (10)
- # rum (52)
- # spacemacs (8)
- # test-check (10)
- # untangled (17)
- # yada (34)
Is there a way to return React dom nodes from a function that normally returns hiccup for Reagent? I need it for React interop with the InfiniteLoader from React-Virtualized.
I think I found it here: https://reagent-project.github.io/news/news050.html
as-element
react-virtualized is awesome by the way
I have some sample code if you need it
for reagent I mean
@pesterhazy That would come in handy I think!
There might also be something in Reagent that takes care of this?
(defn is-row-loaded [props]
(let [{:strs [index]} (js->clj props)]
…)
@borkdude I've gisted it up for you: https://gist.github.com/pesterhazy/10b4a01908e7632825a2321c06130989
didn't have time to clean it up too much, hope it's helpful anyway
@pesterhazy many thanks 🙂
Does Reagent have a utility for this? https://clojurians.slack.com/archives/reagent/p1486657376004840
ah. no unfortunately not
probably better to do (let [index (goog.object/get props "index")])
?
js->clj is not perfectly reliable and may do too much work
I agree it's cumbersome
if you plan to use adv compilation, goog.object/get
is your best option
I think
google closure minifies property names
so it will break direct access like (.-index ...)
yeah externs don't apply in all cases, e.g. callbacks
@pesterhazy What does this notation mean? :> js/ReactVirtualized.AutoSizer
short cut for adapt-react-class
nope, adapt-react-class
right!
Hmm, > Uncaught Error: InfiniteLoader.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
you need to return e.g. (r/as-element [:div ...])
This is what I’ve got right now: https://gist.github.com/borkdude/e64e0701fbe26bace8495ea35d613fb7
Trying to follow these docs: https://github.com/bvaughn/react-virtualized/blob/master/docs/InfiniteLoader.md
Maybe I should write: (r/create-element js/ReactVirtualized.List #js {…})
, but that doesn’t work either
yeah it's a bit outdated
Hi all. core.logic for facts & queries, +reagent for web front-end decision tree for our users. Does it make any sense to even consider using those two birds together?
A lot of systems and constraints make for non-intuitive decisions in the course of our work, hence the desire on my part, to let core.logic do the dirty work of ifs-and-thens.
But not sure how to tie query results
(run* [q] …)
to reagent component defs: (defn advice-component [] (if (run* [q] …
? Could it be that simple?Realize I need to test if no one has done this before (doubtful) but googling for this = nil.
Ok, now I upgraded the cljsjs package myself. I get: Warning: Something is calling a React component directly. Use a factory or JSX instead, for:
(r/create-element js/ReactVirtualized.List
#js {...})
I’m trying to imitate this example in JSX:
<List .... />
Wrapping it in a createFactory gives me the same message, like so:
(def List* (.createFactory js/React js/ReactVirtualized.List))
and then:
(List* #js {…})
but there was also a problem with r/reactify-component
, I had to wrap that result in a factory as well