Skip to content

Commit 54cf5e6

Browse files
committed
starting point
1 parent 362dc45 commit 54cf5e6

File tree

1 file changed

+2
-3
lines changed
  • react/advanced-hooks/05-optimistic-ui/lecture

1 file changed

+2
-3
lines changed

react/advanced-hooks/05-optimistic-ui/lecture/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { useOptimistic, useState, useTransition } from 'react'
1+
import { useOptimistic, useState } from 'react'
22
import { type ResponseData, updateDatabase } from './helpers/mockServer'
33

4-
// Big takeaways:
4+
// Big Takeaways
55
// 1. Homegrown optimistic state works with onSubmit, not with actions
66
// 2. useOptimistic works with actions, not on submit
77

@@ -40,7 +40,6 @@ export function App() {
4040
// const [likes, setLikes] = useState(0)
4141

4242
// const [opLikes, setOpLikes] = useState(0)
43-
// const [pending, startTransition] = useTransition()
4443

4544
// async function submit(e: React.FormEvent) {
4645
// e.preventDefault()

0 commit comments

Comments
 (0)