Static Routes, Nested Routes, And Navigation
In this episode we are going to talk about Next.js Routing, Nested Routes, Link component and we are also going to create a dynamic Navigation for our Next site.
We will actually cover a lot of stuff in this episode. First of all I’m going to show you how to create normal and nested routes (however we are not going to learn about dynamic routes in this episode). Then I will show you how to use Nexts <Link />
component. Then we are going to create our own Navigation component that will link our site together and also how to make those links give visual feedback to the user, so that the user knows on which page he or she is currently on.
This Navigation is going to be hard coded, which is not ideal, so we are going to create that navigation in Strapi, and make it dynamic so that we don’t have to hard code it, cool.
Also you are going to learn the difference between getInitialProps()
and getServerSideProps
and how to correctly get environment variables with getConfig()
.