question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

``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

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
wrongakramcommented, Dec 14, 2022
1reaction
NorkzYTcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NextJS initial state is not updating when routing to same page ...
When using NextJS, getInitialProps is called before the page renders only for the first time. On subsequent page renders (client side ...
Read more >
Creating a Single-Page App in React using React Router
Routing is where you try to map URLs to destinations that aren't physical pages such as the individual views in your single-page app....
Read more >
Slate: Introduction
The data model Slate uses—specifically how operations are applied to the document—has been designed to allow for collaborative editing to be layered on...
Read more >
Build a Full Stack App with Next.js, Tailwind, tRPC and Prisma ...
When we create a TypeScript project that has both a Rest Api and a web app, it becomes challenging to... Tagged with nextjs,...
Read more >
Headless WordPress with React and NextJS (Part 1)
We'll change this up later, but for now, we'll use this to make sure our routes are working once they're set up. Here's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found