Skip to content

Commit 1e83468

Browse files
docs(example): Remove unnecessary data truthiness check (#9485)
Isn't data guaranteed to be truth-y, as part of the larger principle of "Focus on the success case"? We shouldn't need to check for it in the JSX.
1 parent 552fe4b commit 1e83468

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

examples/react/suspense/src/components/Project.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ export default function Project({
2222
<h1>
2323
{activeProject} {isFetching ? <Spinner /> : null}
2424
</h1>
25-
{data ? (
26-
<div>
27-
<p>forks: {data.forks_count}</p>
28-
<p>stars: {data.stargazers_count}</p>
29-
<p>watchers: {data.watchers_count}</p>
30-
</div>
31-
) : null}
25+
<div>
26+
<p>forks: {data.forks_count}</p>
27+
<p>stars: {data.stargazers_count}</p>
28+
<p>watchers: {data.watchers_count}</p>
29+
</div>
3230
<br />
3331
<br />
3432
</div>

0 commit comments

Comments
 (0)