correct workflow order: import & show welcome component ("use client") in "dashboard/page.tsx"
Unanswered
LaPerm posted this in #help-forum
LaPermOP
I import a use client component which shows some welcome message as well as some confetti, when a user's first_signin_accomplished status after db check (appwrite) is false. I do the check in the dashboard's layout.tsx, so its serverside. If user is first time visiting, he should be shown the imported use client welcome component, else I return {childern} in my main/page content part of the dashboard. But the correct workflow bothers me since I always run into the issue, that after a check for first_signin_accomplished that ended with false, the use client component will be returned/shown, which works properly. Additionally I set the first_signin_accomplished to true in this component - but the server code will for any reason be executed a second time (reactStrictMode = false in my config), and then for sure the previously just set to true status-flag is true, and so it does not show my welcome component in reality - since its just overruled by the second iteration of the layout.tsx file where the checks evaluates to first signup completed finally. Sideinfo: I dont want to add query parameters, and also it does not matter whether I update the status flag inside the imported use client welcome component, or directly inside the serverside (dashboard.tsx) - always the same. Is there a way to prevent the second serverside iteration of the code?! Or any other ideas?