In the simplest example:
import {Motion, spring} from 'react-motion';
// In your render...
<Motion defaultStyle={{x: 0}} style={{x: spring(10)}}>
{value => <div>{value.x}</div>}
</Motion>
Which works for me, if I put curly braces around the body of the callback thus:
import {Motion, spring} from 'react-motion';
// In your render...
<Motion defaultStyle={{x: 0}} style={{x: spring(10)}}>
{
(value) => { <div>{value.x}</div> }
}
</Motion>
I get an invariant violation. Am I misunderstanding what is happening here? If I explicitly return the element in the callback, I don't get the invariant violation, but the animation doesn't work.