Skip to content

Step 12 - components directory

Course: NextJS (Client side) - chapter 12

You should put all your components in a components directory and use them in the app routes rather than shoving everything in the route handler

  1. Create a new folder called components in the root of the project
  2. Add a new component there called Signin.tsx
  3. Move the signin logic there
  4. Render the Signin component in app/(auth)signin/page.tsx

Solution

`components/Signin.tsx`
$1b
`app/(auth)/Signin.tsx`
import { Signin as SigninComponent } from "@/components/Signin";
export default function Signin() {
return <SigninComponent />
}