Next.js 14 Blog w/ View Counter and Minute Read

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 12

  • @endlessia
    @endlessia 11 месяцев назад +2

    As usual, very nice video, your channel is really underrated, hope to see it grow soon :)

  • @nalasodev
    @nalasodev 2 месяца назад +1

    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 });
    }

  • @guylepage33
    @guylepage33 10 месяцев назад

    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

  • @ComfyCosi
    @ComfyCosi 4 месяца назад

    What software are you using to record and get your camera in the bottom right?

  • @Monge1h
    @Monge1h 11 месяцев назад +1

    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,
    }

    • @hqasmei
      @hqasmei  11 месяцев назад +1

      Omg thank you I will make sure to add that

  • @faisal_dev951
    @faisal_dev951 10 месяцев назад +1

    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 🥰

    • @hqasmei
      @hqasmei  10 месяцев назад

      of course go ahead!

  • @thephluent
    @thephluent 4 дня назад

    The reason there is duplicate view counts in development is because of react strict mode it renders dom twice.

  • @TheIaTaI
    @TheIaTaI 9 месяцев назад

    Is there a reason why ReportView is a client component? couldn't api/increment/ be also called on the server?

    • @hqasmei
      @hqasmei  9 месяцев назад

      Yup can can also do that I believe

  • @prashlovessamosa
    @prashlovessamosa 10 месяцев назад

    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.