-
Notifications
You must be signed in to change notification settings - Fork 1.2k
v0.3.0 examples
Cheng Lou edited this page Sep 28, 2015
·
5 revisions
<Motion
defaultStyle={{x: 0}}
style={{x: spring(10, [120, 17])}}>
{style => <div style={{left: style.x}} />}
</Motion>
<StaggeredMotion
defaultStyles={[
{x: 0},
{x: 10}
]}
styles={this.getEndValue}>
{values =>
<div>
{values.map((value, i) =>
<div key={i} style={{left: value.x}} />
)}
</div>
}
</StaggeredMotion>
<TransitionMotion
willLeave={() => ({x: spring(100)})}
defaultStyles={{key1: {x: 0}, key2: {x: 0}}}
styles={{key1: {x: spring(10)}}}>
{values =>
<div>
{Object.keys(values).map(key =>
<div key={key} style={{left: values[key].x}} />
)}
</div>
}
</TransitionMotion>