10:4011:50 You need to add a return statement to prevent the view count from increasing unexpectedly. Ideally, the view count should increase only once for each ip address, whether the app is running in development or production. 9:55 if (!isNew) { return new NextResponse(null, { status: 202 }); }
The reason why the API is called twice is because React renders the components twice in development. You can change that behavior by setting the React strict mode to false in next.config.js: module.exports = { reactStrictMode: false, }
Assalamu Alaikum, sister. I have a request: May I use this code on my personal website, I would like to copy it from the repository if u allow & tysm for making this video the way u explain things its so good 🥰
can you please rebuilt your portfolio from scratch for youtube i was reading your code i am struggling to built a simple, fast responsive portfolio like yours some stuff i didn't understand as i am rookie whenever you have time please make tut on it please.
As usual, very nice video, your channel is really underrated, hope to see it grow soon :)
10:40 11:50
You need to add a return statement to prevent the view count from increasing unexpectedly. Ideally, the view count should increase only once for each ip address, whether the app is running in development or production.
9:55
if (!isNew) {
return new NextResponse(null, { status: 202 });
}
Nice work as usual. I use Supabase for my DB. Would you implement the same architecture with Supabase as you have done with Upstash? Thx
What software are you using to record and get your camera in the bottom right?
The reason why the API is called twice is because React renders the components twice in development. You can change that behavior by setting the React strict mode to false in next.config.js:
module.exports = {
reactStrictMode: false,
}
Omg thank you I will make sure to add that
Assalamu Alaikum, sister. I have a request: May I use this code on my personal website, I would like to copy it from the repository if u allow & tysm for making this video the way u explain things its so good 🥰
of course go ahead!
The reason there is duplicate view counts in development is because of react strict mode it renders dom twice.
Is there a reason why ReportView is a client component? couldn't api/increment/ be also called on the server?
Yup can can also do that I believe
can you please rebuilt your portfolio from scratch for youtube
i was reading your code i am struggling to built a simple, fast responsive portfolio like yours
some stuff i didn't understand as i am rookie whenever you have time please make tut on it please.