Next.js 14 Tutorial - 21 - Navigating Programmatically

Поділитися
Вставка
  • Опубліковано 20 лис 2023
  • 📘 Frontend Interview Course - learn.codevolution.dev/
    💖 Support UPI - support.codevolution.dev/
    💖 Support Paypal - www.paypal.me/Codevolution
    💾 Github - github.com/gopinav
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    Next.js 14
    Next.js Tutorial
    Next.js 14 Tutorial
    Next.js Tutorial for Beginners
    Navigating Programmatically
    Next.js Navigating Programmatically

КОМЕНТАРІ • 34

  • @thejoebegs
    @thejoebegs Місяць тому +5

    This tutorial is so helpful. Thank you for being you.

  • @namycodes
    @namycodes 7 місяців тому +3

    🤝♥️thank you for the content vishuas

  • @paulolawale5104
    @paulolawale5104 7 місяців тому +3

    This is awesome

  • @r6sp79
    @r6sp79 4 місяці тому +5

    [memo] import { useRouter } from "next/navigation";

  • @aakashyadav6228
    @aakashyadav6228 6 місяців тому

    loved it, new videos pleaseeeeeee

  • @JackHsieh0715
    @JackHsieh0715 Місяць тому

    awesome bro

  • @GG-oj9kc
    @GG-oj9kc Місяць тому +1

    If in case anyone facing the issue
    Unhandled Runtime Error
    Error: NextRouter was not mounted.
    Please check the import it should be import { useRouter } from "next/navigation"

    • @Aaayushgtm
      @Aaayushgtm 28 днів тому

      thanks bro, hope you have a good day

  • @prafullb4652
    @prafullb4652 5 місяців тому

    Please make video on setting up styled component with next js csr and ssr

  • @abeekudjokoto3887
    @abeekudjokoto3887 7 місяців тому

    Back!!

  • @chesterxp508
    @chesterxp508 Місяць тому

    GoodJob!

  • @rosefrancis1826
    @rosefrancis1826 3 місяці тому

    Thanks for your awesome videos! Question here: why couldn't we just wrap the button in a Link tag and identify the desired href?

    • @SuryaBahadurBasnet
      @SuryaBahadurBasnet 2 місяці тому +1

      You can WHEN there's only one direction. Like going from Home to About using navbar. [You are certain that there's only one point/route to reach to]
      BUT when you encounter going to certain route out of many routes based on certain condition, You may wanna use "useRouter" hook.
      Example:
      -> Suppose you have an order-product, If the transaction/ordering was successful. You may wanna route to "/{productId}/success" and if it's unsuccessful, you may wanna route to "/{productId}/failed".

    • @rosefrancis1826
      @rosefrancis1826 2 місяці тому +1

      @@SuryaBahadurBasnet thank you so much for the detailed response! Makes perfect sense and thanks to you I’ve learnt one additional thing today:)

  • @SteliosNtousios
    @SteliosNtousios 14 днів тому

    A lot of warnings in the console and here it runs only if I add "use client"; at the top. But is it really safe to make this page visible to the client?

  • @ken2ker495
    @ken2ker495 Місяць тому +1

    i have a question but we have Link component , why whe use useRouter to handle routing

    • @isaacjon
      @isaacjon 16 днів тому

      Because we already learnt about link tag, now it's time to learn routing programmatically 😅

    • @kinglegitto1848
      @kinglegitto1848 11 днів тому

      It's because you can programmatically route to anywhere, giving you more control. So you can add it to functions if you want.
      Maybe after an animation finishes then the app will go back to home page on its own, etc...

  • @amdadullahraihan7694
    @amdadullahraihan7694 9 днів тому

    Sir, If I redirect the login page from another app and use a router.back() after login it redirects to that app but it should redirect to the homepage of our app. How can I fix this?

  • @a_mjn_l_l
    @a_mjn_l_l 4 місяці тому

    when i'm using npm run build, it's throwing an error "Error: React Hook "useRouter" is called in function "orderProduct" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"."

    • @a_mjn_l_l
      @a_mjn_l_l 4 місяці тому

      is there a possible fix for that?

    • @NikhilPatel-bq7ck
      @NikhilPatel-bq7ck 4 місяці тому +2

      The solution is actually within your comment written it self

  • @samratescanor8674
    @samratescanor8674 16 днів тому

    So this will be a client side rendered page? @Codevolution

  • @rishiraj2548
    @rishiraj2548 7 місяців тому

    🙏👍

  • @gaminggod1315
    @gaminggod1315 27 днів тому

    sir please send notes all next.js playlist Asap

  • @irahazda
    @irahazda 4 місяці тому +1

    When I am importing useRouter, the auto suggestion shows me two hooks. One from next/navigation and the other from next/router. What's the difference and why do we use next/navigation?

    • @I_am_ZKK
      @I_am_ZKK 2 місяці тому +2

      next/navigation is a newly and advanced packages introduced in a next js 13
      while next/router is old version of next js and mainly purpose for routing within the pages folder of next js application

    • @bikinitony
      @bikinitony 2 місяці тому

      next/router would crash my app as it seems like a previous version. next/navigation works fine!

  • @bitslayerscorpion8776
    @bitslayerscorpion8776 7 місяців тому

    When will this series end ? How many videos still pending ?

  • @raki0125
    @raki0125 7 місяців тому +2

    Router.push? Before watching i am commenting

    • @aakashyadav6228
      @aakashyadav6228 6 місяців тому

      correct

    • @bikinitony
      @bikinitony 2 місяці тому +1

      depends on how you name your const variable. However you should use camelCase for better syntax. so router.push, not Router.push.