Fork me on GitHub

There have been a few discussions about glitches in Reagent but I myself have never seen code that would reproduce them, let alone in a reactive context. Thanks to the help of @hiskennyness, such an example exists now. And even though the view gets the right value in the end, the leaf reaction can get into an inconsistent state which could result in an unexpected behavior in real projects. Created with a reproducible example.

👍 2

"...(except for when" looks truncated.


Ah, thanks - removed.


Does anyone either know an approach or implementation of Codemirror 6 with reagent? My current implementation is not working (cursor losing position at random times seems to be due to async rendering) Looking at reagent docs the recommendation here is to override the js libraries input with an input from reagent (where the necessary wiring is in place on reagents side to deal with async rendering). But looking at docs within Codemirror 6 I don't think this is possible solution (or at least I didn't read where you can pass in an input component and I don't believe it's using an input component to render anyways). Any insights on how best to solve this?


Another solution is to make the component an uncontrolled one and wrap it inside a controlled component. You'd have two extra ratoms to track external model changes, similar to how re-com does it.


Interesting, could you point me to an example of this?


Pretty much every or every other input component in re-com. Look for words like "external" and "internal".


I'd take the first look at the text input components.


Okay thanks! I'll take a look.