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

Function App

transition-test/src/App.tsx:16–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14]
15
16export default function App() {
17 const [index, set] = useState(0);
18
19 const onClick = () => set(state => (state + 1) % 3);
20
21 const transitions = useTransition(index, {
22 from: { transform: 'translate3d(100%,0,0)' },
23 enter: { transform: 'translate3d(0%,0,0)' },
24 leave: { transform: 'translate3d(-100%,0,0)' },
25 })
26
27 return (
28 <div className='container' onClick={onClick}>
29 {transitions((style, i) => {
30 const Page = pages[i]
31 return <Page style={style} />
32 })}
33 </div>
34 )
35}

Callers

nothing calls this directly

Calls 1

useStateFunction · 0.90

Tested by

no test coverage detected