Fork me on GitHub
#reagent
<
2017-02-15
>
minikomi04:02:08

Hi there. I'm trying to integrate React-motion into a reagent project so I can have a simple enter/exit animation for some components. I have a working example here: https://gist.github.com/minikomi/6c256784247672693f72a01fe9401582 Unfortunately, the child component is constantly re-rendered.. doesn't matter in this simple test case, but if the child contains a lot of nested components it can slow things down. I'm wondering if there's a way to use perhaps should-component-update to prevent the child re-rendering?

mikethompson05:02:23

We find it works nicely for entry/exit/move annimations

minikomi05:02:55

great .. i'll check it out.

minikomi05:02:08

I'd love to get to the bottom of why the child component is re-rendering all the time though .. or, rather, how to prevent re-renders in reagent when there's no ratoms involved

mikethompson05:02:30

Do you use key ?

minikomi05:02:18

I've tried giving all child elements unique keys, to no avail

minikomi05:02:06

The react-motion issues seem to mention using shouldComponentUpdate .. but I'm not sure how to work it into a reagent component

minikomi06:02:08

Turns out that breaking out the reagent/reactify-component call so that it's only called once was the key

pesterhazy09:02:55

interesting! another "reloading gotcha"

deas11:02:02

Anyone else already working on getting reagent play nice with node_modules?

pesterhazy15:02:39

I haven't yet but definitely interested @deas

deas15:02:01

Ran 101 tests containing 2046 assertions. 2 failures, 0 errors.

deas15:02:30

@pesterhazy And it seems the two ones which fail do so because of a change in react (CamelCase strings).

pesterhazy15:02:18

what's that output?

deas15:02:45

reagent test running on node_modules.