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

How to animate input field using React spring

Currently I'm working on React Weather app and I'm trying to animate input field from the middle of app to the top of the app. This animation should fire when Axios call will be full-filled. In this input field you are supposed to type name of the…
0
votes
1 answer

react-spring - set the initial value of an interpolation

The following will animate from 1 to 2. const [props, set] = useSpring(() => ({ value:1 })); set({value: 2}); However, let's assume Iwant the value to be instantly changed to 3, and then animated to 2, regardless of what it is currently. In other…
John Smith
  • 3,863
  • 3
  • 24
  • 42
0
votes
1 answer

Calling setState when IntersectionObserver threshold is reached?

I'm using react-spring and IntersectionObserver to animate some div elements on my page. For the IntersectionObserver, I am using a hook given by the tutorial here. CodeSandbox While I am able to get the div to rotate by itself (onClick), and the…
Carrein
  • 3,231
  • 7
  • 36
  • 77
0
votes
1 answer

how to run animation in sequence one by one in react spring

I am using react-spring library, it works for me, what i want to do, i want to run 3 animation in sequence, right now all 3 animation run at a time, can we do it one by one, here i have added my whole code, can anyone please look into it, and help…
Nikul Panchal
  • 1,542
  • 3
  • 35
  • 58
0
votes
2 answers

getting error : React Hook "useSpring" is called conditionally

when i run my below code, i am getting this error : React Hook "useSpring" is called conditionally can anyone please help me why i am getting this error ? any help will be really appreciated, here i have mention my code, i did some googling but…
Nikul Panchal
  • 1,542
  • 3
  • 35
  • 58
0
votes
1 answer

i want to make a toggle div by react spring but i got this error (TypeError: Object(...) is not a function)

i want to make a toggle div by react spring but i got this error (TypeError: Object(...) is not a function) import React , {useState} from 'react' import { useSpring ,animated} from 'react-spring/renderprops' const Togg =()=>{ const …
Hossam Thapet
  • 129
  • 1
  • 6
0
votes
1 answer

React Spring acting stiff, as if no mass or friction

I'm using react spring to animate an object translating up the page and disappearing. For some reason, the object is moving the same speed throughout the animation, no matter what I set the spring configs to. I currently have: import React,…
Josh Bangle
  • 251
  • 3
  • 16
0
votes
1 answer

Animating elements with react-spring usesprings hook

Trying to animate a bunch of objects to their positions, and useSpring works for me (for single element), but useSprings is not for 3 objects. Here is demo (mousedown red…
0
votes
1 answer

Want a button to trigger the drag animation (translateX) for cards example

It is regarding the following example: https://codesandbox.io/s/cards-forked-4bcix?file=/src/index.js I want a tinder like functionality where I can trigger the same transition as drag. I am trying to add like and dislike button functionality like…
Haris Khan
  • 389
  • 1
  • 2
  • 12
0
votes
4 answers

react-spring parallax - cannot register onScroll event when scrolling through parallax

I am using the Parallax component from react-spring to achieve a parallax effect on a parent component. Within this component, there are a bunch of background shapes that are within the parallax
hillybob991
  • 97
  • 11
0
votes
1 answer

How do I set up React-spring in codepen?

I tried to create a basic setup to start practicing react-spring in CodePen, but it shows an error: Uncaught ReferenceError: require is not defined. I don't know why this happens and how to fix it. This is the code of my app so far (as you can seee,…
Arnold Gee
  • 856
  • 2
  • 8
  • 18
0
votes
1 answer

How to display and animate React Component depending to result of condition with React Spring?

I'm struggling on rendering React component depending to result of condition. To be more accurate I'm working on Alarm clock App where you can set time when alarm should 'ring'. There are 3 functions which are updating every second thru…
Pinnci
  • 423
  • 2
  • 5
  • 20
0
votes
1 answer

items shuffled during transition-out of usetransitions

I'm trying to use the react-spring useTransition hook to toggle between an array of items and an extended version of the same array. The transition looks fine when expanding, but when transitioning back, the items get shuffled. Specifically, the…
DaanH
  • 57
  • 7
0
votes
1 answer

React Native with React spring Launch 'Invariant Violation'

I was trying to make a simple animation on a button just to see if it was working, for that i used react-spring 1, but a problem occurs. That's what i'm doing to create the animation: import React from "react"; import { animated, Spring } from…
Luca Pasini
  • 141
  • 8
0
votes
0 answers

How to call internal function in react component from different component?

I've created a component that uses a css linear-gradient to render a random linear gradient. When the user presses a button located somewhere else in my component tree (header), I want the gradient to: Randomly generate a new gradient Interpolate…
msalla
  • 717
  • 6
  • 23