Skip to content

[v9.0.0-rc.2] Event props in useSprings props function are not saved for future updates #997

Closed
@aleclarson

Description

@aleclarson

In v9-beta.34, I could pass onFrame to useSpring like this

const [props, set] = useSprings(pages.length, i => ({
    x: i * window.innerWidth,
    scale: 1,
    display: 'block',
    onFrame: f => console.log(f),
    onRest: f => console.log(f)
}))

I've updated onFrame -> onChanged, but neither onChange or onRest seem to get called

const [props, set] = useSprings(pages.length, i => ({
    x: i * window.innerWidth,
    scale: 1,
    display: 'block',
    onChange: f => console.log(f),
    onRest: f => console.log(f)
}))

repro: https://codesandbox.io/s/viewpager-s2ukf?file=/src/index.js

Originally posted by @tim-soft in #985 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions