AppTree is not updated client side
See original GitHub issueBug 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:
- Created 4 years ago
- Reactions:11
- Comments:8 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To whom it may concern, I put in a PR to fix this: #23721
@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.