How to Access the URL Params in React with React Router's useParams Hook

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

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

  • @Aaron-sy5yx
    @Aaron-sy5yx 2 года назад +8

    Love how you left the error in and explained in detail how to fix it. Much better than having a "perfect" video where everything just works.

  • @onlinecitizen8414
    @onlinecitizen8414 2 месяца назад

    Thank you so much! I watched so many videos on this and your's the the only one so far that explains the correlation of the useparam object property name with the one set by programmer in the route definition.

  • @marinav3940
    @marinav3940 Год назад

    Best description! Thank you so much. Most youtube dev pages talk too fast and don’t explain the little important things.

  • @taylorbarron4950
    @taylorbarron4950 2 года назад +6

    This is exactly what I needed to complete my project. Well put in less than 10 minutes. Thank you!

  • @antipusrises
    @antipusrises Год назад

    I really appreciate that you used TypeScript in this, as I was dealing with a very similar type issue in my code and this helped me understand things better.

  • @MBogan
    @MBogan Год назад

    Brilliant guide, I was really struggling to wrap my head around this before I found your video, thank you!

  • @diegoguatemala5287
    @diegoguatemala5287 Год назад

    exactly what I needed, just right to the point and very well explained! You can tell how much experience he's gotten! Thanks for this man!

  • @lucianasuciu4798
    @lucianasuciu4798 2 года назад +1

    i love you !! 😂😍 I was searching for 3h for this information. Thanks a lot ! 😘

  • @vasilemidrigan50
    @vasilemidrigan50 2 года назад

    A nice observation about another tutorials regarding to id .......

  • @qingsong4099
    @qingsong4099 3 года назад +1

    Great guide!!! This is what I have been looking for!!! Thank you so much for such a clear and detailed explanation!

  • @munawarhussain4040
    @munawarhussain4040 2 года назад

    Thanks a lot man. I had seen a number of videos but all of them were using another technique.

  • @mohammadhuzaifa5985
    @mohammadhuzaifa5985 Год назад

    Great guide last one day I was searching but you solve my problem thanks. I do 777 like and 55 comment complete😂😂😂😂

  • @Barzx
    @Barzx 3 года назад +1

    it is a shame that this doesn't works with router 6, is a good video

  • @aris13pat1
    @aris13pat1 2 года назад

    Thank you. The best explanation I've come across.
    Subscribed!
    Keep up the good work!

  • @buteranelly3132
    @buteranelly3132 3 года назад

    Thanks man you have no idea how much you've helped me

  • @sanjamsinghkalsi5937
    @sanjamsinghkalsi5937 3 года назад +1

    Thankyou so much!!! Really helped me in my company's project! :)

  • @width19
    @width19 2 года назад

    goshhh, you explain things so clearly

  • @mertsuhaigac167
    @mertsuhaigac167 2 года назад

    you saved my day this is exactly what I needed thanks for the tutorial

  • @kmax2356
    @kmax2356 Год назад

    Really thank you brother, It was help to release my stress... 🥰

  • @JOEY-xj4ds
    @JOEY-xj4ds 2 года назад

    Update: 'Switch' has been changed to 'Routes'. Just happened like a few days ago lol

  • @jimcarpenter7174
    @jimcarpenter7174 3 года назад

    Thank you! This is exactly what I was looking for.

  • @nagalakshmibutti8067
    @nagalakshmibutti8067 Год назад

    useParams() is not working in the Class component. Then how can we get URL parameters when we use class component instead of a function component?

  • @ColabGuy
    @ColabGuy 2 года назад

    Nice!
    I used it to create a referral link.

  • @nituchoudhury1294
    @nituchoudhury1294 Год назад

    Thanks a ton! This is really very helpful

  • @ryansatchell2302
    @ryansatchell2302 2 года назад

    Any vids on doing this without useParams? I can't convert my react class to a SFC and thus hooks are not allowed.

  • @sirbalafort2620
    @sirbalafort2620 3 года назад

    Great tutorial! I have a question: If I didn't want to pass the destructured { id } into the body where I am rendering, where would I pass it into the component? Say, for the purposes of rendering individual blog posts and for practical reasons not wanting the { id } to show up in the body with the blog texts.

    • @edutechional
      @edutechional  3 года назад

      I'm not sure if I completely understand what you're wanting to do, but you could always create nested components and then pass the ID value as a prop

    • @sirbalafort2620
      @sirbalafort2620 3 года назад +1

      @@edutechional That answers my question, thank you!

  • @tajanamarijaatanaskova2201
    @tajanamarijaatanaskova2201 3 года назад

    Thank you so much!!! I really needed this

  • @shepniel
    @shepniel 2 года назад

    Excellent video, thanks for sharing :)

  • @thebrain678
    @thebrain678 2 года назад

    Is there a way to initially start use params with the value? What I mean is without clicking on the route so you just start the page off with already a value

    • @taylorbarron4950
      @taylorbarron4950 2 года назад

      useEffect with the param value is probably what you want to do if you haven't figured it out yet

  • @ionlytakeaction3773
    @ionlytakeaction3773 3 года назад

    Great amazing guide, what theme?

  • @nemss5366
    @nemss5366 8 месяцев назад

    bro ? can use UseParams on a class component ? above render method ?

  • @soaibshaikh8559
    @soaibshaikh8559 2 года назад

    hey! i want to get url data using class component how can i get this ?

  • @ne1butu1
    @ne1butu1 2 года назад

    This was fantastic. Thank you!

  • @Room3102
    @Room3102 2 года назад

    Awesome tutorial. I think you might have helped solve a problem of mine. Instant subscribe.

  • @knwoledgeseeker381
    @knwoledgeseeker381 2 года назад

    I've done the same but my username and password are showing in the URL wich i dont like.. any idea how to hide it ??

  • @ishowvideos11
    @ishowvideos11 2 года назад

    Hey,
    Can you please make a video on passing URL params using react-router-dom V6?

  • @Djolesabijacica
    @Djolesabijacica 2 года назад

    nice explanation

  • @kunalpatil1250
    @kunalpatil1250 3 года назад

    i want to pass user id in url , then what should i do

  • @binhtruong3373
    @binhtruong3373 3 года назад

    Thanks so much, it really helps

  • @mpb0406
    @mpb0406 3 года назад

    Great explanation!

  • @salarhashemian3436
    @salarhashemian3436 2 года назад

    Thanks man! this really helped

  • @calebbogale8262
    @calebbogale8262 Год назад

    very helpful thanks

  • @vivekn4u
    @vivekn4u 3 года назад

    hi, nice tutorial also can you explain how to get from data in a hook like a query string. in PHP we use $_POST[""], but not able to find anything in reactjs except query string for URL params. Thank you in advance

    • @edutechional
      @edutechional  3 года назад

      If you're using React Router, it's very similar to the process I showed. They have a 'useParams' hook that let's you get the query string value, this shows how to use it: reactrouter.com/web/example/url-params

    • @vivekn4u
      @vivekn4u 3 года назад

      @@edutechional thank you for the reply but my use case is that the payment gateway is sending the success/failure response to my reactjs page route and the reply is in Form data, if the data is in url I can get it using query string but don't know how to get this form data (POST method) which is In key-value pair.

  • @coreydevl7021
    @coreydevl7021 2 года назад

    thanx for the help!

  • @harutinnnn1
    @harutinnnn1 2 года назад

    In a function, this is clear, but how to do it in a class?

  • @abhishekraut2518
    @abhishekraut2518 3 года назад

    Thank you man !

  • @shadowrebels1623
    @shadowrebels1623 6 месяцев назад

    perfect !

  • @expectations2188
    @expectations2188 Год назад

    love you man ..

  • @cengiz-ilhan
    @cengiz-ilhan 2 года назад

    clear english :)

  • @Human_Evolution-
    @Human_Evolution- 3 года назад

    flew over my head at the end : ???? : ?????? meeeeh

  • @amritraj658
    @amritraj658 3 года назад

    Thankuu so much

  • @erwinharnaldolauracuisara8360
    @erwinharnaldolauracuisara8360 2 года назад

    thanks!!!!

  • @selindemircioglu3502
    @selindemircioglu3502 2 года назад

    THANKSSSSSSS CNM

  • @welingsonsantos9572
    @welingsonsantos9572 3 года назад

    Thanks

  • @filip23128
    @filip23128 2 года назад

    thanx

  • @andybiersack4906
    @andybiersack4906 3 года назад

    #useParams()