Skip to content

Default props can't be overridden by inline props #1123

@tomdohnal

Description

@tomdohnal

🐛 Bug Report

(A clear and concise description of what the bug is.)

To Reproduce

  1. Press the toggle button in the demo. The square animates OK.
  2. Press it again -> it animates "immediately". This is expected as we set default: { immediate: true } in the setStyle(...) call.
  3. Press it yet again -> it animates "immediately". This is NOT expected as we set immediate: false in the setStyle(...) call. It works as expected if we use default: { immediate: false } and override the "default" props. However, I think the default props should be overridden by setting specific props in the function calls.

See https://codesandbox.io/s/quirky-goodall-6z3og?file=/src/App.js

Expected behavior

The default props should be overridden by "inline" props.

Link to repro (highly encouraged)

https://codesandbox.io/s/quirky-goodall-6z3og?file=/src/App.js

Environment

  • react-spring v9.0.0.-rc3
  • react v16.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions