28
loading...
This website collects cookies to deliver better user experience
npm i react-spring
import { useSpring, animated } from 'react-spring'
const styles = useSpring({
loop: true,
from: { rotateZ: 0 },
to: { rotateZ: 180 },
config: {duration:4000}
})
<animated.div
style={{
styles
}}
/>
import React from 'react'
import { useSpring, animated } from 'react-spring'
// import Login from './components/Jarvis/Login'
function App() {
const styles = useSpring({
loop:true,
from:{
rotateZ:0
},
to:{
rotateZ:180
},
config:{duration:1500}
})
return (
<animated.div
style={{
width: 80,
height: 80,
backgroundColor: '#46e891',
borderRadius: 16,
...styles}}
/>
)
}
export default App