Relative Content

Tag Archive for javascripttypescriptnext.js

How to correct implement white labelling with NextJS?

I need to create a project of multiple website using the same NextJS app but with a different backend and a different theme. For the backend it’s quite easy since I just use process.env at building time to get different connection.

Show/Edit dynamic routes inside catch-all router of Next.js App Router

I have a Next.js app router setup like this that shows /:category-handle and /products/:product-handle correctly, I need the product handle to be changed so that it shows /:category-handle/:product-handle. I have tried nesting the product folder inside [...category] folder but since its a catch all segment, it cannot show the dynamic routes inside it. I have looked through the Next.js docs and it looks like its not documented anywhere on how to achieve this. The [...category] is a catch all since there are other routes as well e.g. about, faqs etc. and without the catch all the category route throws a 404.

Calendar created with NextJS does not start with correct day

I have this code that renders a calendar (screenshot either attached or in the next message). Last month we started on a monday so it was fine but this month (may), it starts on a Wednesday. So, the calendar starts rendering on a Wednesday. I want to add a couple of empty boxes at the start so it always starts on a monday.