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.

AppTree is not updated client side

See original GitHub issue

Bug report

Describe the bug

The <AppTree /> is not updated client-side, i.e. a first version of <AppTree /> is computed server-side and then it is always the same client side.

To Reproduce

A code such as the following would be sufficient:

import { renderToStaticMarkup } from "react-dom/server";

const App = ({ Component, pageProps }) => {
  return <Component {...pageProps} />;
};

App.getInitialProps = async ({ AppTree }) => {
  console.log("AppTree:", renderToStaticMarkup(<AppTree pageProps={{}} />));

  return {};
};

export default App;

For reproduction, I made a Codesandbox: https://codesandbox.io/s/nextjs-apptree-bug-pdkf3

If you click on the link and look at the console, you will see that whatever the page, <AppTree /> is always the same.

System information

  • Version of Next.js: 9.2.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:11
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
zenflowcommented, Apr 7, 2021

To whom it may concern, I put in a PR to fix this: #23721

4reactions
zenflowcommented, Apr 13, 2020

@ijjk I see you added AppTree in PR #7732. What are the chances of fixing it to work on client-side renders? 😀

It would be really great to be able to use it to prefetch data for a page before rendering/showing it, regardless of whether the rendering is happening server-side or browser-side, to get rid of unwanted <Loader/> renders where we have nothing to show the user. In this scenario, the user waits on the previous page until the next page is ready. The user can navigate from fully-formed page to fully-formed page, within the site now, not just when entering the site (when SSR is used). It seems like generally a better UX.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AppTree is not updated client side · Issue #10126 · vercel/next.js
Bug report Describe the bug The is not updated client-side, i.e. a first version of is computed server-side and then it is always...
Read more >
Props not updated at Client side, when returning from server ...
The logic is i am trying to login, and when login fails, it should get the new props from the query object. It...
Read more >
Article - AppTree Enterprise
At AppTree, we know that teams perform best when every member is not only skilled ... The code you write will be shared...
Read more >
MERN Full-Stack Tutorial 2020 — Part 2 (frontend/client-side)
Try running the client app again, npm run start , to see if everything still works after deleting those files and references… Add...
Read more >
Appletree Dentistry: Welcome - Tigard Dentist
Welcome - Your Premier Family Dentist in Tigard, Oregon. Call (503) 620-2185 and schedule an appointment today!
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