# Having issues with brower navigation back to search page in NextJS

**URL:** https://discuss.elastic.co/t/having-issues-with-brower-navigation-back-to-search-page-in-nextjs/365383
**Category:** Elasticsearch
**Created:** [August 22, 2024, 12:52pm UTC](https://discuss.elastic.co/t/having-issues-with-brower-navigation-back-to-search-page-in-nextjs/365383 "2024-08-22T12:52:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Justin\_Schoen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_schoen/32/122349_2.png) [@Justin\_Schoen](https://discuss.elastic.co/u/Justin_Schoen)
#### Post date: [August 22, 2024, 12:52pm UTC](https://discuss.elastic.co/t/having-issues-with-brower-navigation-back-to-search-page-in-nextjs/365383/1 "2024-08-22T12:52:23Z")

</div>

## Background:

- We are using Elasticsearch
- We are using the search-ui package for react
- We are using Nextjs

## What's happening?

We have a search page that's using the `SearchProvider` component to wrap all the filters, results, etc. The search results include a link to another page (not another search page, but a more detailed page about the item you clicked). You click the link and you're redirected to the new page, but, when you click the browser navigation to go back to the search page there's no redirect. The url does get updated to the correct search page url which for us is `/profiles/search`, but you remain on the item detail page.

I've done a lot of debugging and am pretty sure I've narrowed it down to the `SearchProvider` component. If I remove the usage of `SearchProvider` entirely the navigation works. I've tried adding a randomly generated key to the provider but that doesn't work. I've tried a dozen other things with console logs to say that the component has remounted but it never does on browser navigation.
