Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slate-React (Next.js) Slate isn't updating data after route change #5207

Open
wrongakram opened this issue Dec 1, 2022 · 5 comments
Open

Comments

@wrongakram
Copy link

``Description
Using Next.js, SWR had tried SSR but still no luck :/

On first load the data is fetched using SWR and passed to Slate. Once I change routes the data is fetched but Slate isn't getting the data from the Database anymore

Recording
https://loom.com/share/508c7c4ad5e040d7bc42fc8955c593c1

Sandbox
A link to a sandbox where the error can be reproduced. (You can start from the base sandbox here: https://codesandbox.io/s/slate-reproductions-c7gyg or refer to the Slate website too.)

Expectation
Everytime I change routes Slate should update its value to match onces coming in from the DB

Environment

  • Slate Version: "slate": "^0.85.0",
  • Operating System: macOS
  • Browser: Chrome

carbon

@wrongakram
Copy link
Author

Only occurs if I use Next / Link

@NorkzYT
Copy link

NorkzYT commented Dec 12, 2022

@wrongakram

I saw your loom video, and I have a similar issue that is listed below. Did you ever resolve this issue?

#5220

@wrongakram
Copy link
Author

@NorkzYT Nope :/ Can't seem to figure it out either... using and tag instead of next/link forcing it to refresh the page work but awful UX. Really need to use next/link but can't seem to find a solution.

@wrongakram
Copy link
Author

@NorkzYT Think I may have found a solution

https://www.loom.com/share/e69b259f95e6465196d33e2b70815501

@NorkzYT
Copy link

NorkzYT commented Dec 14, 2022

@NorkzYT Think I may have found a solution

loom.com/share/e69b259f95e6465196d33e2b70815501

@wrongakram
Thank you very much for the video, I appreciate it. I saw the video and this looks promising as to what I want to accomplish.
Please do advise if your solution stops working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants