Now that we’ve got our basic single component (named [slug].js), which displays a single post, let’s look at how easy it is to add the comments area. First, let’s build 2 components: 1) CommentList.js and 2) CommentForm.js. In Next.js, when creating components that doesn’t use a route – we place them in the “components” directory. […]
Month: August 2020
Coding the Single Post component with Next.js
Still working with Next.js and WordPress here – as described in my previous post. I’m at the single post now, and as it turned out – it’s really easy to build the basic functionality. So in Next.js – you simply add a component in the “Pages” directory to “route” the requests. For dynamic routes – […]