CodingNic

Navigation and Persistence

Connect Favorite Links

Navigation and Persistence 20 min read

Connect Favorite Links

Connect Favorite Links

Use Next.js Link to navigate a stored favorite pair back into the converter.

javascript
<Link href={`/?to=${b}`}>Convert</Link>

The target route should read the query parameter and use it to initialize or update the selected target currency.

Test it

Open a favorite from /favorites and confirm the Convert page opens with the expected pair.

Checkpoint

Favorites are useful navigation shortcuts, not just a list.