Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Next Links: Back button reloads the whole page #425

Closed
danielbeardsley opened this issue Jul 11, 2022 · 7 comments
Closed

Next Links: Back button reloads the whole page #425

danielbeardsley opened this issue Jul 11, 2022 · 7 comments
Labels
0 bug Something isn't working

Comments

@danielbeardsley
Copy link
Member

Problem

I thought the next back button was just supposed to ping the props endpoint and be a faster transition. I wasn't expecting it to blank the whole page for a second or two.

Repro

  1. Visit: https://es.ifixit.com/Parts/iPhone
  2. Click a subcategory
  3. Click "back" via your browser
  4. Slower and more abrupt than following the link in step 2 (which must just replace the props)
@danielbeardsley danielbeardsley added the 0 bug Something isn't working label Jul 11, 2022
@dhmacs
Copy link
Contributor

dhmacs commented Jul 12, 2022

Unfortunately this right now is by design to patch the Algolia bug on routing. This happens because Algolia routing doesn't play well with Next.js routing (see this issue) . I've experimented with implementing a custom history, but it was taking too much time so I've employed this trick.
Another possible solution is to manually maintain the url as suggested here.

If you come up with a better solution that would be awesome, otherwise we'll keep trying new package versions until the issue is fixed and we can drop this patch.

@chr-ge
Copy link

chr-ge commented Aug 5, 2022

@dhmacs What trick are you referring to that you've employed?

@dhmacs
Copy link
Contributor

dhmacs commented Aug 6, 2022

@chr-ge To force a full page reload when the back button is pressed (instead of relying on client side navigation)

@sterlinghirsh
Copy link
Member

I wonder if we could abandon the back button hack if we make the links normal links instead of NextLinks as in algolia/react-instantsearch#818

@dhmacs
Copy link
Contributor

dhmacs commented Oct 13, 2022

You mean having the page fully reload on every filter link click?

@sterlinghirsh
Copy link
Member

No I'd rather not fully reload. I was imagining having Algolia manage the url there, but I remember now there was a problem with that approach if both Algolia and next want to handle the back button.

@sterlinghirsh
Copy link
Member

Sounds like this may be addressed with the nextjs algolia update so I'll close this for now.

@sterlinghirsh sterlinghirsh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants