Skip to content

[bug]: Animated div typescript error regarding children prop #2358

Open
Capventis/react-spring
#5
@jeeheezy

Description

@jeeheezy

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

What's Wrong?

Animated tags don't seem to support children prop for TypeScript. This seems similar to issue #2332, but I'm not using Next 15/React 19, I am currently using Next 14.2.24 and React 18.3.1.

Image

The animated.div only has an SVG (made React component by SVGR) as a child. While I was able to get around the issue by using the animated function instead and passing a component in there (i.e. see second image, there are no typescript errors present there), I'm sure there would be situations where having animated.div take children would be preferable compared to defining a component separately.

Image

To Reproduce

Use an animated tag with children elements

Expected Behaviour

No Typescript issue

Link to repo

No public repo currently

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