I've encountered an issue in the Building a Language Switcher section of the guide for integrating useParaglideJsWithNextjsAppRouter. The example provided for the LanguageSwitcher component seems to misinterpret the value returned by the usePathname hook.
Issue:
The usePathname hook is expected to return a string representing the current pathname. However, the current guide's syntax { pathname } = usePathname() implies that it returns an object with a pathname property, which is incorrect.
Expected Correction:
The correct usage should directly assign the string returned by usePathname to a pathname variable like so:
With this correction, the pathname variable will correctly store the string value representing the current path, and the Link component can function as intended.
I believe updating the guide with the correct usage can prevent confusion for future readers. Thank you for looking into this issue.
Hello,
I've encountered an issue in the Building a Language Switcher section of the guide for integrating useParaglideJsWithNextjsAppRouter. The example provided for the LanguageSwitcher component seems to misinterpret the value returned by the usePathname hook.
Current Implementation:
Issue: The usePathname hook is expected to return a string representing the current pathname. However, the current guide's syntax { pathname } = usePathname() implies that it returns an object with a pathname property, which is incorrect.
Expected Correction: The correct usage should directly assign the string returned by usePathname to a pathname variable like so:
With this correction, the pathname variable will correctly store the string value representing the current path, and the Link component can function as intended.
I believe updating the guide with the correct usage can prevent confusion for future readers. Thank you for looking into this issue.
cheers