Skip to content

[bug]: useSpring Events not firing (Next.js 13) #2146

Description

@lairdkruger

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.2

What's Wrong?

API events are not triggering at all.

To Reproduce

Setup a Next.js 13.3.0 project, try useSpring with events. Try to do something in the event eg:
const [{ x }, api] = useSpring( () => ({ x: 0, // onChange is currently broken with Next App structure onChange: { x: () => { console.log("onChange"); // This should be logging the value on drag }, }, }), [] );

Expected Behaviour

Expected console to log "onChange".

Link to repo

https://codesandbox.io/p/sandbox/dawn-leaf-lqof4b?selection=%5B%7B%22endColumn%22%3A11%2C%22endLineNumber%22%3A12%2C%22startColumn%22%3A11%2C%22startLineNumber%22%3A12%7D%5D&file=%2Fpages%2Fworking%2Findex.tsx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions