What's the different between react-router and Next.js

前端 未结 2 1981
借酒劲吻你
借酒劲吻你 2021-02-19 04:31

i\'m currently expolring ReactJS i saw NextJS and React Router

Can anyone tell me what\'s the pro cons between the two. I\'m not sure if it\'s right to compare the two,

2条回答
  •  無奈伤痛
    2021-02-19 04:53

    Next.js (see also alternatives like GatsbyJS and After.js) are full featured SSR/static site frameworks, so you get a lot of features out of the box if you need to generate a SSR static site. These frameworks have solved lots of problems, so adding a feature becomes as simple as reading the docs, rather than researching and coding on your own.

    If you code your own setup with a standard React app and react-router then you might find yourself running into a lot of complexity and edge cases when you dig into SSR.

    In short, if SSR is a core requirement definitely consider using a SSR React framework.

提交回复
热议问题