Home

Posts

Nextjs project guidelines

These are my preffered project guidelines in nextjs: Project Structure - public/: For static assets - src/app/: For Next.js 13+ app router pages and layouts - src/components/: For reusable React components - src/hooks/: For custom hooks, organize

MK

Martin Kulvedrøsten Myhre

13:00-9/5/2024

Handling domain specific locale in next.js

When we deployed https://inmeta.no we decided to add a swedish (.se) page but we wanted to completly divide them when it comes to content. This meant we would not be doing the traditional /[locale]/...content also called i18n routing. Turned out tha

MK

Martin Kulvedrøsten Myhre

06:30-8/29/2024

Event listener hook for react

Events can be very hard to work with in react so i made a type safe hook that simplifies the process. The last thing i want is to download a whole hook library just for one hook so the simplest thing is to add it yourself. Usage:

MK

Martin Kulvedrøsten Myhre

12:30-10/25/2023

How to only deploy on spesific branches with Vercel

I found that its was not straight forward to configure Vercel to only deploy on the main branch so here is a guide and i hope it saves you some time. Note that in this project i am using Next.js but it should work with most frameworks. First we nee

MK

Martin Kulvedrøsten Myhre

10:00-9/26/2022