@@ -11,11 +11,7 @@ type Post = {
1111 body : string
1212}
1313
14- function Posts ( {
15- setPostId,
16- } : {
17- setPostId : ( id : number ) => void
18- } ) {
14+ function Posts ( { setPostId } : { setPostId : ( id : number ) => void } ) {
1915 const [ posts , setPosts ] = useState < Post [ ] > ( [ ] )
2016 const [ loading , setLoading ] = useState ( true )
2117 const [ error , setError ] = useState < Error | null > ( null )
@@ -46,10 +42,7 @@ function Posts({
4642 < div >
4743 { posts . map ( ( post ) => (
4844 < p key = { post . id } >
49- < a
50- onClick = { ( ) => setPostId ( post . id ) }
51- href = "#"
52- >
45+ < a onClick = { ( ) => setPostId ( post . id ) } href = "#" >
5346 { post . title }
5447 </ a >
5548 </ p >
@@ -166,11 +159,10 @@ function App() {
166159 { win && render ( < Mounted /> , win . document . body ) }
167160 < Feature />
168161 < p >
169- As you visit the posts below, you will notice them in a loading
170- state the first time you load them. However, after you return to
171- this list and click on any posts you have already visited again, you
172- will see them load instantly and background refresh right before
173- your eyes!{ ' ' }
162+ As you visit the posts below, you will notice them in a loading state
163+ the first time you load them. However, after you return to this list
164+ and click on any posts you have already visited again, you will see
165+ them load instantly and background refresh right before your eyes!{ ' ' }
174166 < strong >
175167 (You may need to throttle your network speed to simulate longer
176168 loading sequences)
0 commit comments