Next.js Discord

Discord Forum

When reload, components change

Unanswered
Snowy Egret posted this in #help-forum
Open in Discord
Snowy EgretOP
Hello, is there any way to achieve components not changing when user is still logged in? I have component user profile on my website, when i click F5 (reload the page) the component dissapears and quickly gets back, can i avoid this?

7 Replies

and those data must be from the db and you need some time to fetch them. why don't you have a suspense around your component and show fallback UI
@James4u and those data must be from the db and you need some time to fetch them. why don't you have a suspense around your component and show fallback UI
Snowy EgretOP
I understand you, my data are fetched from the PHP beckend, don’t ask why 😆, bud that really doesn’t care, i just want to avoid data disappearing when page reloads while they appears back the same way as they were before. I’ve seen this on many sites already but didn’t manage to achieve this
Snowy EgretOP
y
@Snowy Egret y
as long as you are using Next.js you can still manage it
it's okay to use PHP backend or whatever - just have fallback Ui