Skip to content

[bug]: Event Handlers not getting called in StrictMode #2203

Open
@helgenlechner

Description

@helgenlechner

Which react-spring target are you using?

  • @react-spring/web
  • @react-spring/three
  • @react-spring/native
  • @react-spring/konva
  • @react-spring/zdog

What version of react-spring are you using?

9.7.3

What's Wrong?

When using <StrictMode> in React 18, the event handlers (onStart, onRest...) don't get called.

To Reproduce

In the linked StackBlitz project, you can see in the Console that only the console.logs in the useEffect hook get executed. The event listeners never get called. If you disable StrictMode in index.tsx, the event listeners get called as expected.

Expected Behaviour

Event listeners get called in StrictMode.

Link to repo

https://stackblitz.com/edit/stackblitz-starters-jphu4a?devToolsHeight=33&file=src%2FApp.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions