Hey! Nice tutorial, thank you for that, great work!
I wonder how the breadcrumb component gets notified about the changing route, because it seems like you don´t even have to listen to some events or similiar.
Could you tell me how the breadcrumb component knows when to update itself? (and which part of your provided code is responsible for that?)
it updates it self with the useMemo's dependencies array [router.asPath, router.pathname, router.query, getTextGenerator, getDefaultTextGenerator]
I think you could take off the router.query from the dependencies since the router.query is an object and will not know if the values of that object are changing but will have to try that
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey! Nice tutorial, thank you for that, great work!
I wonder how the breadcrumb component gets notified about the changing route, because it seems like you don´t even have to listen to some events or similiar.
Could you tell me how the breadcrumb component knows when to update itself? (and which part of your provided code is responsible for that?)
Kind regards,
Jendrik
it updates it self with the useMemo's dependencies array [router.asPath, router.pathname, router.query, getTextGenerator, getDefaultTextGenerator]
I think you could take off the router.query from the dependencies since the router.query is an object and will not know if the values of that object are changing but will have to try that