React router is a package that I use in almost all of my projects. Not too long
ago, Michael Jackson tweeted this. This made me curious as to how d...
For further actions, you may consider blocking this person and/or reporting abuse
Great Effort !! brother 😁
I don't have much experience with useCallback,
Can you please explain this
How callback will detect that setLocation is changed !!
setLocation is just setter funciton right.
useCallback() hook is used to capture the whole function just a way to optimize the performance like as memoisation.
useCallback() used in conjunction with useEffect() because it allows you to prevent the re-creation of a function.
I hope this information helps you in understanding the useCallback() hook in react.
@Cheers
adnanaslam
Thanks brother!!
Thanks for pointing this out! You are correct! We don't need to pass setLocation here in the callback dependencies as it won't change. Will update the post now, thank you!
Great content and so few likes! That's because it's hard to understand in 5 mins :)
Thanks! Yeah definitely agree it's a lot for a quick read. I am thinking about also accompanying the post with a video tutorial which might be easier to digest.
Great post. I always wondered how React Routed worked internally, but never dived into the code. This article made it much clear to me.
Thanks
Great to hear! Thanks for the comment.
Great article!
I noticed a common ‘mistake’ in your code. I wrote about it here: medium.com/@ewestra/great-article-...
Great feedback! I'l be sure to update the post. Thank's for the comment!
Nice work. Thank's
Great Post !
Can you please explain where params in params[index] is defined?
Thanks.
🤦♂️ I was missing a line. Sorry about that! Have updated the post now. Thanks for the comment!
Awesome man, thanks a lot!
You're welcome! Glad you liked the read :) Hoping to do similar posts for other popular packages.