Questions tagged [react-spring]

react-spring is a set of simple building blocks that should cover most of UI related animation needs in a react application.

React-spring is a library which supports different types of animation. It is used to create different types of 2d, 3d shapes and has lot of animation effects which would otherwise take a lot of css styles to implement.

For more info check the below link:

React Spring Github

437 questions
1
vote
2 answers

Spring animation is not working in ReactJS

The below Spring animation is not working in ReactJS. I have a Component class written like this: import React from "react"; import { Component } from 'react' import { Spring } from 'react-spring' export default class Menu extends Component { …
Daniel Klimek
  • 77
  • 1
  • 7
1
vote
0 answers

npm ERR! ERESOLVE unable to resolve dependency tree when installing react-spring animation

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: react@17.0.2 npm ERR! node_modules/react npm ERR! peer react@">=16.x" from @fortawesome/react-fontawesome@0.1.14 npm ERR! …
1
vote
2 answers

react-spring and typescript not callable error

I am unable to make the simplest example of react-spring work: import { useSpring } from 'react-spring/three' export const myComponent = () => { const [spring, setSpring] = useSpring(() => ({ xpos: 0 })) setSpring({xpos: 10}) return ( …
Zamadhi Eturu
  • 131
  • 2
  • 10
1
vote
1 answer

React CSStransition or React-spring in map()

Can someone explain how to make smooth transition like opacity 0 - opacity 1 with CSStransiton or react-spring animation, when data comes from server and i'm doing map div instantly appears without transition. i want to make transition on form…
1
vote
2 answers

How can I use react-spring useTransition to go from left to right or viceversa

I have a Switch and a Router, and whenever the route changes, it goes from left to right, I would like to know if there's a simple way that the animation can go from right to left based on the change of the route. Thanks in…
Rodrigo R
  • 423
  • 1
  • 6
  • 12
1
vote
2 answers

Animate-up number with thousand separators

When using react-spring to animate-up a number from 0 to x, is it possible to display that number with commas as "thousand separators" (as described here)? The goal is to display this number as "123,456" - while still animating it up nicely! const x…
Ben
  • 15,938
  • 19
  • 92
  • 138
1
vote
1 answer

react-three-fiber + react-spring desync?

I am trying to do a simple animation with react-three-fiber and react-spring where there are a bunch of 3d objects in a grid, and each one scales up when hovered/selected and back to normal when it is not hovered/selected. This was working when I…
Turmolt
  • 113
  • 9
1
vote
1 answer

How to animate texts on onClick event using react-spring?

So, I am using NextJs and React-spring to make a "Random Quote Machine" (A freecodecamp challenge which I completed previously but I just wanted to try out new things,e.g using nextjs and react-spring animation) So everything works well, but when I…
tanjim anim
  • 337
  • 3
  • 23
1
vote
1 answer

React Spring Transition with React Context animates after component has already updated

I have a React component that should subscribe to a React Context and render some text. When the context updates the text should update, but when this update occurs I want to animate the component out with the old value and animate it in with the…
1
vote
1 answer

React spring fade images in/out when prop changes

I have a product tile component which accepts an imageSrc prop. Whenever the imageSrc prop is updated, I want the old image to fade out as the new image is fading in. With my current implementation, the animation does not work. I can confirm that…
Ian Springer
  • 223
  • 2
  • 7
  • 19
1
vote
1 answer

How to make a react custom component animated using react-spring

I have a react custom component called HomeContent that accepts some props. To make that animated as per the react-spring documentation I made const animatedHomeContent = animated(HomeContent); Then for rendering I did like this: …
1
vote
0 answers

React-Spring causes current page to scroll to the top before transitioning to next page

I am using react-springs to transition from page to page in a NextJS web app. To reproduce the error: Open the codesandbox link: https://codesandbox.io/s/nextjs-page-transition-react-spring-ggx7n?file=/pages/_app.js Navigate to the bottom of live…
SILENT
  • 3,916
  • 3
  • 38
  • 57
1
vote
1 answer

can't get the chain effect working with useChain by react-spring

I am new to use react-spring. Currently(writting a react webapp with typescript), i am trying to apply the useChain chaining up three useSpring but what i come out with is all animation starts at the same time.....but i suppose it should have the…
PDw
  • 11
  • 1
  • 3
1
vote
2 answers

How to start react-spring animation only on startup

I'm trying to figure out how to trigger the animation only once at the startup of the app.. Currently I'm facing the problem that If I switch to another view(another component, using React-router-dom) and then switch back to Home component,…
Pinncik
  • 321
  • 3
  • 14
1
vote
1 answer

How to design a modulo spring

I have a spring that is applied to a rotating element: This thing needs to rotate left and right. If I attach the angle to a spring, sometimes the rotating circle takes the long way around. What is the correct way to implement a modular spring in…
ethanabrooks
  • 747
  • 8
  • 19