App reviews, troubleshooting, and recommendations
Hello.
I want to use Navigation in Next.js,
But There are no contents React Hooks or React Components in docs(https://shopify.dev/docs/api/app-bridge-library/apis/navigation )
unlike previous-version docs(https://shopify.dev/docs/api/app-bridge/previous-versions/actions/navigation )
Only Remix version of the guide exists in that document.
(I don't have any plan using Remix.)
How to Migrate useNavigate in App Bridge React 4.x.x using Next.js?
Thank you.
Hi @camerafi-dev ,
Did you find a solution for it?
Thank you.
Hi @camerafi-dev,
I don't use Next.js but ended up here while looking for a solution for vanilla react.
There is a hook in the react-router-dom library. So this works for me:
import { Link } from "@shopify/polaris";
import { useNavigate } from "react-router-dom";
const navigate = useNavigate();
<Link onClick={() => navigate(`/page`)}>Page</Link>
import { Link } from "@shopify/polaris";
import { useRouter } from 'next/navigation'
const router = useRouter();
<Link onClick={() => router.push(`/page`)}>Page</Link>
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025