最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - when to use Nextjs over the React itself? - Stack Overflow

programmeradmin2浏览0评论

I'm new to React library, I know the core functionality of React and I built simple web applications with it, and of curse, I'm taking advantage of the amazing create-react-app mand using npx. The web applications that I built earlier were CSR ( Client Side Render ) applications which are not CEO friendly, if you want to implement SSR in your web app using create-react-app you should make an effort to do it by reading some articles and know a little bit about Nodejs and Express and so on ...

a few days ago I encountered something wonderful called Next.js a React framework that is built on top of the React library which has SSR technology built-in and has its own folder structure and other advantages of a great framework.

so here are my questions, is there any case in a real project that we don't want our application to be SSR except the user dashboard or admin panel? and when do we need to use Next.js over the React itself?

I know in some cases it's better to not reinvent the wheel, so I would be really appreciated if you could share your knowledge and experiences in this particular case with us.

Thanks a lot.

I'm new to React library, I know the core functionality of React and I built simple web applications with it, and of curse, I'm taking advantage of the amazing create-react-app mand using npx. The web applications that I built earlier were CSR ( Client Side Render ) applications which are not CEO friendly, if you want to implement SSR in your web app using create-react-app you should make an effort to do it by reading some articles and know a little bit about Nodejs and Express and so on ...

a few days ago I encountered something wonderful called Next.js a React framework that is built on top of the React library which has SSR technology built-in and has its own folder structure and other advantages of a great framework.

so here are my questions, is there any case in a real project that we don't want our application to be SSR except the user dashboard or admin panel? and when do we need to use Next.js over the React itself?

I know in some cases it's better to not reinvent the wheel, so I would be really appreciated if you could share your knowledge and experiences in this particular case with us.

Thanks a lot.

Share Improve this question edited Apr 24, 2021 at 8:55 Parsa Mir Hassannia asked Dec 3, 2020 at 20:08 Parsa Mir HassanniaParsa Mir Hassannia 3612 gold badges6 silver badges17 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

is there any case in a real project that we don't want our application to be SSR?

For example when you are building a kind of user's panel where public access is not alowed and SEO is not important. Another case is hosting Next.js app - you need Node.js environment on you server, while CRA buils simple static files. At early stage of projects it's easy to deploy and maintenance.

Next.js is great when you need SEO or a kind of simple API for backend tasks (database connections, forms etc...). On advanced projects I think it's better to move your backend logic into seperated API.

From the other hand Next.js requires other approach of thinking, sometimes ponents are rendered on server side, sometimes in client's browser, which may be not clear for beginers.

I think it's better to strat with CRA and then, when you'll see a real need then add Next.js into your CRA project.

发布评论

评论列表(0)

  1. 暂无评论