Skip to content

Commit 96b7dd4

Browse files
committed
Add missing line highlights in SinglePostPage.tsx (Part 7: RTK Query Basics)
1 parent d32970b commit 96b7dd4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/tutorials/essentials/part-7-rtk-query-basics.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,17 +479,19 @@ export const SinglePostPage = () => {
479479
const currentUsername = useAppSelector(selectCurrentUsername)
480480
// highlight-next-line
481481
const { data: post, isFetching, isSuccess } = useGetPostQuery(postId!)
482-
482+
483+
// highlight-next-line
483484
let content: React.ReactNode
484485

486+
// highlight-next-line
485487
const canEdit = currentUsername === post?.user
486488

487489
// highlight-start
488490
if (isFetching) {
489491
content = <Spinner text="Loading..." />
490492
} else if (isSuccess) {
491-
// highlight-end
492493
content = (
494+
// highlight-end
493495
<article className="post">
494496
<h2>{post.title}</h2>
495497
<div>
@@ -506,7 +508,8 @@ export const SinglePostPage = () => {
506508
</article>
507509
)
508510
}
509-
511+
512+
// highlight-next-line
510513
return <section>{content}</section>
511514
}
512515
```

0 commit comments

Comments
 (0)