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
3
votes
1 answer

react-spring single-component mount/unmount reveals

i'm trying to create animation when component mount/unmount with React-spring: import { Transition, animated } from 'react-spring' ... export class CompName extends PureComponent { static defaultProps = { …
Volodymyr Humeniuk
  • 3,411
  • 9
  • 35
  • 70
2
votes
1 answer

Babel loader issue "You may need an additional loader to handle the result of these loaders" `/@react-spring/web/dist/`

I am currently forking uniswap for a testnet not a live application I have tied in the testnet and deployed the contracts. Before doing this I was able to get it into a docker container. After doing this I am running yarn…
2
votes
2 answers

Can't build React project at CloudFlare Pages

Believe me, I don't have any idea about this and I can share the error with you: Compiled with problems: ERROR in ./node_modules/@react-spring/core/dist/index.mjs 1596:0-45 Module not found: Error: Can't resolve '@react-spring/types/animated' in…
oooogz
  • 41
  • 1
  • 5
2
votes
0 answers

How to reset animation in react-spring?

Intro: I'm trying to reset animation after some user activities(such as "clicking on close button", etc). Code: const animation = useSpring({ from: { scale: 1 }, to: { scale: 1.15 }, config: { duration: 1000 …
nrjshka
  • 189
  • 8
2
votes
3 answers

How to remove an element from useSprings array by id

I'm using react spring's useSprings hook. My implementation of this hook takes a variable number for the count, and then has an associated configuration. My hook implementation looks like this: const [activeTokens, setActiveTokens] =…
jamesdlivesinatree
  • 1,016
  • 3
  • 11
  • 36
2
votes
0 answers

Animate the camera with react-three-fiber

So what I am trying to do is animate the camera after it finds the mesh id. Right now it works, but it teleports to the mesh instead of animating the camera to the make. I have tried react-sprint and @react-three/drei, but I just can't figure this…
2
votes
1 answer

What will be prop types of useSpring

I'm using react spring for animating svg paths, toggling strokeDashArray. Here I've written this in the parent const dashArrayAnimation = useSpring({ loop: { reverse: true, }, from: { strokeDasharray: toggle ? 0 : 5 }, to: {…
Talha
  • 45
  • 8
2
votes
0 answers

How to animate an object along an SVG path React-Spring

I'm trying to animate an circle in an svg along a path using react-spring but im not sure how to go about it. I know I need the ref on the path so I can get the total length of the path and then use getPointAtLength to get the x and y to move the…
matt
  • 21
  • 2
2
votes
1 answer

Dragging elements to new positions independently using useSprings hook (+useDrag)

I was expecting each element to be updating independently, according to its latest positioning. However, moving an element after having moved another causes this unwanted behavior. export function Ingredients({ ingredients }: IngredientsProps) { …
mjfneto
  • 93
  • 1
  • 8
2
votes
2 answers

Trigger animation in react-spring on condition

how do I trigger an animation on a condition. For example I want to fade in a component only when the user scrolled to the part of the page. If I would just do a normal useSpring() the animation would trigger right away even if it is at the bottom…
Allleex
  • 137
  • 9
2
votes
1 answer

How to implement a simple transition between two components

I'd like to implement a simple transition between two components using react-string. My current attempt is at https://codesandbox.io/s/react-spring-simple-transition-16qhf?file=/src/App.tsx: import React, { useState } from 'react' import {…
chipit24
  • 6,509
  • 7
  • 47
  • 67
2
votes
0 answers

How to achieve Stack like animation with user click event in React/Typescript

I want to animate my component like below (showing up new Container from bottom and Stack on the previous container) when user click the button. After researching few libraries, I noticed React Spring might be a good way to achieve Stack component…
husky
  • 831
  • 3
  • 10
  • 24
2
votes
2 answers

card slide down in react spring not working

I am new to react and I am trying to slide down my div element using react-spring. However, the slide-down effect is not working. I saw this in a tutorial and tried to implement it however it's not working. Here is my code:
sambit
  • 256
  • 2
  • 18
2
votes
2 answers

Start animation in react-spring when component is in view

I am using react-spring for animation and all the animations start once the page is loaded. I want to control the start of the animation. The desired outcome is to let the components down in the screen start the animation once they are in view (i.e…
John C.
  • 405
  • 5
  • 19
2
votes
0 answers

React Spring useTransition doesn't animate smoothly with conditionally rendered components

I've been working on a small website using react and wanted to animate the mobile menu coming in and out of view on state change. I've heard that react-spring useTransition is perfect for this use case and have been trying to figure it out for the…