You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error you're encountering is due to the way the redirect is being handled in the TransactionsPage component. In Next.js, you can't return a redirect object directly from a server component. Instead, you should use the redirect function from next/navigation. Let's modify the code to fix this issue:
file: app/transactions/page.tsx
// ... existing imports ...
import { redirect } from 'next/navigation';
// ... existing code ...
export default async function TransactionsPage({ params, searchParams }: { params: {}; searchParams: { page: string } }) {
// ... existing code ...
if (page > totalPages) {
// Redirect to the last valid page if the requested page is out of range
redirect(`/transactions?page=${totalPages}`);
}
// ... rest of the component code ...
}
// ... rest of the file ...
The text was updated successfully, but these errors were encountered:
The error you're encountering is due to the way the redirect is being handled in the TransactionsPage component. In Next.js, you can't return a redirect object directly from a server component. Instead, you should use the redirect function from next/navigation. Let's modify the code to fix this issue:
file: app/transactions/page.tsx
The text was updated successfully, but these errors were encountered: