This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-31
Channels
- # aws (1)
- # beginners (82)
- # boot (7)
- # cider (1)
- # cljs-dev (13)
- # cljsrn (1)
- # clojure (37)
- # clojure-dev (5)
- # clojure-italy (5)
- # clojure-spec (9)
- # clojure-uk (8)
- # clojurescript (110)
- # community-development (6)
- # datomic (1)
- # devcards (1)
- # fulcro (12)
- # lein-figwheel (1)
- # off-topic (34)
- # portkey (24)
- # protorepl (25)
- # re-frame (4)
- # reagent (29)
- # shadow-cljs (8)
- # spacemacs (11)
- # specter (3)
- # unrepl (1)
- # vim (1)
So I don't have a reproducer that I can share (yet), but I've been using reagent with React 16, and ran into a really weird event propagation issue. It's roughly: a parent element with a handler (say on-click), and a child with also some on-click, and in the child handler I reset!
a reagent atom, that causes a rerender with e.g. a modal or similar. When that modal closes (and only then) does an event suddenly propagate up to the parent element.
I'll try and build a reproducer that I can share (and raise an issue with), but just wondering if anyone else has had similar issues with React 16 and reagent
a backtrace on the parent's handler isn't terribly helpful as it just traces back to batchedUpdates within React
@alex340 I’m trying but failing to google for the issue, but there is an oddity with event handlers that changed from 15 to 16
try consistently returning nil from the event handler and see if that makes the behavior consistent
well, I found some old reagent docs talking about that, but it didn't really seem applicable anymore
looks like some issue with the event scheduling within reagent vs react 16's fibers to me
this is crazy, but have you confirmed that the handler actually returns after the reset!
? it is hard to understand how the event handling mechanism could be influenced by any of this unless something is getting triggered synchronously off of the reset!
didn't check that, no, although a synchronous render from the event handler is what I was thinking
another thought: are you programmatically causing a click event anywhere and is there any possibility that that code is being called on rerender in a way you don’t expect
i don’t even think it is possible to re-render in the middle of an event handler but i’m not that experienced with these kind of browser edge cases
Juho might know but I think he’s on central europe time. probably helpful to have a repo
upon a bit of further investigation I think I might actually be running into https://github.com/facebook/react/issues/11387