Next.js Discord

Discord Forum

Intercepting grouped routes

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
Hi everyone I'm facing an issue with intercepting routes with app router.

I have folder structure like in the first image
The home page route renders fine, but when I click on login i want to show a modal with a login form in it, so i introduced @authmodal intercepting route. The modal render fine at the proper route segment -> /signin, but i do expect to see the "home page" behind the modal when this is open.

Layout under [locale]/(pages)/(auth)/layout.tsx has this code
import React from 'react';

const AuthLayout = async ({
  authmodal,
  children,
  params: { locale },
}: {
  authmodal: React.ReactNode;
  children: React.ReactNode;
  params: { locale: string };
}) => {
  return (
    <>
      {authmodal}
      {children}
    </>
  );
};
export default AuthLayout;

Thanks in adavance to everyone

0 Replies