React-spring: Feature request: different config for enter and leave for Transition

Created on 15 Feb 2019  Â·  6Comments  Â·  Source: pmndrs/react-spring

Would it be possible to have different animation config for enter and leave of Transition? it makes sense to enter slower but leave faster

Most helpful comment

useTransition({ config: (item,state) => {
  switch (state) {
    case "enter": return { tension: 50 }
    case "leave": return { friction: 100 }
}})

All 6 comments

That’s possible, config can be a function that receives the item and the state (enter, leave, ...) and returns a new config.

@drcmda can you help provide a code example?

useTransition({ config: (item,state) => {
  switch (state) {
    case "enter": return { tension: 50 }
    case "leave": return { friction: 100 }
}})

Thanks, is it possible using render props? we are still largely using React class component
On 16 Feb 2019, 10:03 AM +0800, Paul Henschel notifications@github.com, wrote:

useTransition({ config: (item,state) => {
switch (state)
case "enter": return { tension: 50 }
case "leave": return { friction: 100 }
})
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Sure, it’s the same

@drcmda Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rockmandash picture rockmandash  Â·  3Comments

lennerd picture lennerd  Â·  3Comments

VincentCtr picture VincentCtr  Â·  3Comments

jmcruzmanalo picture jmcruzmanalo  Â·  4Comments

sakhisheikh picture sakhisheikh  Â·  3Comments