MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / App

Function App

react-spring-test/src/App3.tsx:4–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import './App.css';
3
4export default function App() {
5 const [styles, api] = useSpring(() => {
6 return {
7 from: {
8 width: 100,
9 height: 100
10 },
11 config: {
12 // duration: 2000
13 mass: 2,
14 friction: 10,
15 tension: 400
16 }
17 }
18 });
19
20 function clickHandler() {
21 api.start({
22 width: 200,
23 height: 200
24 });
25 }
26
27 return <animated.div className="box" style={{ ...styles }} onClick={clickHandler}></animated.div>
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected