Skip to content

"Warning: NaN is an invalid value for the opacity css style property" in @react-spring/web but it works 100% as intended #1445

Answered by joshuaellis
revosw asked this question in Support
Discussion options

You must be logged in to vote

if you wanted to do the following:

<StyledFrontFace  style={{
  opacity: opacity - 1,
  transform
}} color={cardColor}>
  ...
</StyledFrontFace>

You should use the to method of the SpringValue:

<StyledFrontFace  style={{
  opacity: opacity.to(o => o - 1),
  transform
}} color={cardColor}>
  ...
</StyledFrontFace>

I think that should work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@revosw
Comment options

Answer selected by revosw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants