I'm recently using react-spring
and it works really well but I'm having some issues when I have to apply an onClick
on childs.
Here is my main structure:
<anim.button className="c"
style={{ opacity: opacity.interpolate(o => 1 - o), transform }}>
<Bar />
</anim.button>
<anim.button className="c"
style={{ opacity, transform: transform.interpolate(t => `${t}
rotateX(180deg)`) }}>
<Bar />
</anim.button>
An onClick
on the anim.button
would work perfectly fine of course, but that's not what I'm trying.
Here is my <Bar />
component:
const Bar = () => (
<div className="bar">
<Checkbox
onClick={() => {
set(state => !state)
}}
/>
</div>
)
I also tried using the <anim.div>
instead of an <anim.button>
but this gives me the same results.
Now the problem here is that it seems like react-spring
puts a layer onto my <Bar />
component. Is there a way to use the onClick
in my component instead of the one that is used onto anim.button
?