Next.js Discord

Discord Forum

Is it ok to have MVC file structure inside a route (app router)?

Answered
Manx posted this in #help-forum
Open in Discord
Avatar
ManxOP
I'm so used to MVC pattern from Expressjs, but since Nextjs is adhering to React's philosophy of components, I feel like committing a war crime against the framework when using such approach.

I don't like long TSX components, so I wanna break them down, is there a standard I should follow?
Answered by Clown
Its upto you.

Models are usually defined separately anyways, the view(the component) is separate and obviously you can separate the controller(route handlers/server actions)
View full answer

2 Replies

Avatar
Its upto you.

Models are usually defined separately anyways, the view(the component) is separate and obviously you can separate the controller(route handlers/server actions)
Answer