Next.js Discord

Discord Forum

Catch all Route not working !!!

Answered
Asian swamp eel posted this in #help-forum
Open in Discord
Avatar
Asian swamp eelOP
why it giving me error ? trying to use catch all route

import NewsList from "@/components/news-list";
import { getNewsForYear } from "@/lib/news";
import React from "react";

function FilteredNewsPage({ params }) {
  const filter = params.filter;
  condole.log(filter)
  // const news = getNewsForYear(newsYear);
  // return <NewsList news={news} />;
}

export default FilteredNewsPage;
Answered by AlbertC0527
remove the page.jsx in @archive and it should work
View full answer

6 Replies

Avatar
Asian swamp eelOP
Image
Avatar
Asian swamp eelOP
Image
Avatar
I think it is because /archive/@archive will match both the page.jsx under [[...filter]] and the one above it
Avatar
Asian swamp eelOP
@archive and /archive both will match ?
Avatar
remove the page.jsx in @archive and it should work
Answer
Avatar
Asian swamp eelOP
thx work