Skip to content

Commit 89cfba9

Browse files
authored
fix: add nullish coalescing operator to fix eslint error (#2087)
1 parent 0d52764 commit 89cfba9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/young-clubs-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-t3-app": patch
3+
---
4+
5+
Replace if statement with nullish coalescing to fix eslint error

cli/template/extras/src/trpc/react.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ const getQueryClient = () => {
1717
return createQueryClient();
1818
}
1919
// Browser: use singleton pattern to keep the same query client
20-
if (!clientQueryClientSingleton) {
21-
clientQueryClientSingleton = createQueryClient();
22-
}
20+
clientQueryClientSingleton ??= createQueryClient();
21+
2322
return clientQueryClientSingleton;
2423
};
2524

0 commit comments

Comments
 (0)