Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: AnimatedComponent incorrectly interprets className prop as class-name attribute #2291

Closed
1 of 5 tasks
LoganDark opened this issue Jun 13, 2024 · 2 comments · Fixed by #2292
Closed
1 of 5 tasks
Labels
template: bug This issue might be a bug

Comments

@LoganDark
Copy link
Contributor

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?

<animated.div className={springValue} /> only updates className each React render. When the springValue updates, then a class-name attribute is updated instead of className.

To Reproduce

Pass a FluidValue className to an AnimatedComponent.

Expected Behaviour

className should be updated, not class-name.

Link to repo

https://codesandbox.io/p/sandbox/dawn-platform-vclx4j

@joshuaellis
Copy link
Member

why do you expect className to be animated value?

@LoganDark
Copy link
Contributor Author

LoganDark commented Jun 13, 2024

why do you expect className to be animated value?

I expect when I set className={springValue} for the className prop to be animated, not a class-name attribute. I don't expect className to always be anything in particular, I just want it to work in the rare case that I do want to animate it.

(If I pass class={springValue} it works, but that isn't idiomatic React.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template: bug This issue might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants