Skip to content

Commit

Permalink
fix: update useQuery types
Browse files Browse the repository at this point in the history
fixes #1412
  • Loading branch information
geromegrignon committed Sep 19, 2023
1 parent a9d2444 commit 7e4002f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/demo/src/app/pages/article/article.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const articleQuery = (slug: string) => ({

export const loader =
(queryClient: QueryClient) =>
async (slug: string): Promise<{ data: Article }> => {
async (slug: string): Promise<Article> => {
const query = articleQuery(slug);

return await queryClient.ensureQueryData(query);
Expand All @@ -31,7 +31,7 @@ export default function ArticlePage() {

const { data: article } = useQuery<Article>({
...articleQuery(slug),
initialData: initialData.data,
initialData: initialData,
});

return (
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/src/app/pages/profile/profile.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const profileQuery = (username: string) => ({

export const loader =
(queryClient: QueryClient) =>
async (username: string): Promise<{ data: Author }> => {
async (username: string): Promise<Author> => {
const query = profileQuery(username);

return await queryClient.ensureQueryData(query);
Expand All @@ -43,7 +43,7 @@ export default function ProfilePage({ defaultTab }: Props) {
const navigate = useNavigate();
const { data: profile } = useQuery<Author>({
...profileQuery(username),
initialData: initialData.data,
initialData: initialData,
});

const [page, setPage] = useState(1);
Expand Down

1 comment on commit 7e4002f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.