Skip to content

[react-pose] SVG Path Update Fails #645

Description

@amcdnl

Bug

When animating a path of an SVG, once the path is set on enter and the data changes later, it fails. If needed, I can make a demo of this too.

Error

hey-listen.es.js:12 Uncaught (in promise) Error: HEY, LISTEN! Values 'M0,139.55556L171,174.44444L385,0L513,139.55556' and 'M0,139.55555555555554L125,174.44444444444446L280,0L374,139.55555555555554L451,261.6666666666667L482,104.66666666666669L513,209.33333333333334' are of different format, or a value might have changed value type.
    at invariant (hey-listen.es.js:12)
    at createComplexAction (popmotion.es.js:514)
    at vectorAction (popmotion.es.js:527)
    at popmotion.es.js:673
    at Action.start (popmotion.es.js:118)
    at startAction (popmotion-pose.es.js:328)
    at pose-core.es.js:158
    at new Promise (<anonymous>)
    at pose-core.es.js:146
    at Array.map (<anonymous>)

Code

export const PosedLine = posed.path({
  enter: {
    d: ({ enterProps }) => enterProps.d,
    delay: ({ index }) => index * 10,
    transition
  },
  exit: {
    d: ({ exitProps }) => exitProps.d
  }
});

then in the JSX -

<PosedLine
          pose="enter"
          poseKey={enterProps.d}
          pointerEvents="none"
          stroke={stroke}
          fill="none"
          enterProps={enterProps}
          exitProps={exitProps}
          index={index}
        />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pose is deprecatedReact Pose users can upgrade to Framer Motion: https://framer.com/motion

    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