This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-24
Channels
- # aws (3)
- # aws-lambda (1)
- # beginners (16)
- # boot (36)
- # cider (3)
- # cljs-dev (90)
- # cljsjs (1)
- # cljsrn (27)
- # clojure (240)
- # clojure-austin (1)
- # clojure-berlin (3)
- # clojure-dusseldorf (2)
- # clojure-france (2)
- # clojure-germany (12)
- # clojure-russia (19)
- # clojure-spec (20)
- # clojure-uk (56)
- # clojurescript (218)
- # clojurex (1)
- # cursive (21)
- # datomic (10)
- # events (1)
- # hoplon (18)
- # instaparse (19)
- # jobs-discuss (3)
- # lein-figwheel (3)
- # luminus (3)
- # lumo (14)
- # off-topic (4)
- # om (76)
- # onyx (67)
- # protorepl (12)
- # re-frame (54)
- # reagent (35)
- # ring (2)
- # spacemacs (5)
- # specter (2)
- # sql (11)
- # untangled (144)
- # yada (34)
i have a component that when mounted does some set up with the underling element via dom-node
, but when figwheel reloads i get the following error which breaks the page until i manually reload. any ideas?
Uncaught Error: findDOMNode was called on an unmounted component.
(https://github.com/facebook/react/issues/4233, so maybe not a reagent specific issue)
@rodeorockstar which lifecycle method are you calling dom-node in?
hard to say without seeing the code
in any event I'd use a ref callback instead
it's made for the job
findDOMNode is sorta kinda deprecated
for ref callbacks see https://presumably.de/reagent-mysteries-part-3-manipulating-the-dom.html
wow i had no idea about the :ref property, and i think that'll solve my exact use case!
remember the callback gets called both on mount (with the node as arg) and on unmount (with nil as arg)
so usually you end up using (when node ...)
no but I've used reagent for a while now
I really dig it 🙂
absolutely. my first encounter with react was via reagent but i recently had to code a project in vanilla-ish react and it was painful. coffeescript + react.dom made it slightly more bearable but it pales in comparison!
on a side note, in your blog post, should :ref (function [el]...) read :ref (fn [el]...)?
thanks, fixed (once caches are invalidated)
cool! didn't mean to sound pedantic, just making sure i wasn't disregarding some secret reagent/function included in a :use somewhere 🙂
if I wrap map-indexed
as the warning suggests, the warning is not thrown anymore. Anyway, I'd like to understand why it thrown after reseting the vector atom and how I could I avoid without wrapping in doall
@tomass, I've blogged about this: https://presumably.de/reagent-mysteries-part-1-vectors-and-sequences.html
personally I think
- lazy seqs in reagent are an anti-feature. Use explicit (into [:div] (map ...))
instead
- using meta-data to supply keys is an anti-feature. Use [:div {:key n}]
explicitly instead
essentially, explicit is better than implicit
thanks again @pesterhazy 🙂
if I’m now using cljsjs to use React Virtualized, but I want to be able to step through that code (which the UMD build is not so suited for), what’s my best option?
Basically I want to be able to step through this function: https://github.com/bvaughn/react-virtualized/blob/ad6200c15844a5585032e2848b8fd90af3e66143/source/InfiniteLoader/InfiniteLoader.js#L106