Fork me on GitHub
#reagent
<
2016-05-12
>
escherize04:05:32

There's an issue with cljsfiddle, where sometimes there's nothing to unmount, so Run no longer works

madvas06:05:01

@michael.heuberger: I’ve tried your user-menu component in clean reagent project and it works normally. I was using reagent "0.6.0-alpha2” and cljs-react-material-ui "0.2.12"

Petrus Theron10:05:24

Is there a guide to testing reagent components? One of our devs is new to ClojureScript and coming from Python grabs for mocking internal symbols (rebind) for testing components, which feels wrong to me. Can anyone substantiate my intuition about this or tell me I’m wrong?

mikethompson12:05:57

For a while now I've been meaning to write up this kind of information about keys. If you are new to Reagent, you might find this interesting: http://stackoverflow.com/a/37186230/5215391

upgradingdave15:05:04

Hi all, I’ve been experimenting with CSSTransitionGroup. When I follow along with this recipe, it work great: https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/ReactCSSTransitionGroup

upgradingdave15:05:46

But when I try something a little more complicated (a tree view with list of lists) it doesn’t seem to work and I think I’m missing something subtle

upgradingdave15:05:07

anyone used CSSTransitionGroup in more complex widgets? any advice for troubleshooting?

upgradingdave16:05:22

ah ha! This was it. If I make sure that the css-transition-group is mounted before the list items that I want to animate, it works great. (https://facebook.github.io/react/docs/animation.html#animation-group-must-be-mounted-to-work)

mattsfrey21:05:37

I’m having a really interesting problem

mattsfrey21:05:27

I have a component that represents a row, takes in two components that represent selected or deselected, and displays whichever one based on local state

mattsfrey21:05:54

i have a conditional in one of the components being passed in

mattsfrey21:05:22

and apparently when the row component re-renders, it’s not evaluating the higher up component so that conditional never runs again

mattsfrey21:05:35

so the component thats supposed to be displayed conditionally never shows up

mattsfrey21:05:45

any ideas on what I’m doing wrong here ?

danielcompton21:05:57

@mattsfrey: Reagent is only going to re-render a component if data changes. settings-row doesn’t dereference @pw-focused?-, so it’s not going to know that it’s changed and that it should re-render

danielcompton21:05:08

If I understand your code correctly

mattsfrey21:05:20

trying to think of a good way to stick to this model and have it re-render without doing something hacky

mattsfrey21:05:48

although it seems like I might have to pull the conditional for selected up into the parent component and just pass a “contents"

danielcompton21:05:02

I’m not a reagent expert, but I wonder if there is a more idiomatic way of doing what you’re doing here

mattsfrey21:05:25

same lol, definitely doesn’t seem very good

lewix23:05:55

@mattsfrey: can I see the code

mattsfrey23:05:55

sry I deleted the gist, I just decided to move the conditional to the parent component, no real other way to do it minus sending down an unnecessary prop just to force re-renders

lewix23:05:00

@mattsfrey: I don't think I understand the whole context and I don't have any clojurescript experience whatsoever but I believe that you can also set the state of the result of the conditional in the 'row' component

lewix23:05:41

Either that or pass it as a prop from the parent component (which I think you are already doing)