Next.js Discord

Discord Forum

Prop is undefined after being modified by a server component.

Unanswered
Oriental posted this in #help-forum
Open in Discord
OrientalOP
Hello everyone. I am back with my second problem in next.

So I am making a survey app. I pull the survey data out of a google sheet and then show the questions grouped by their category with a button to go to the next "page" of questions. The questions have an associated point value that I need to use later so I stored all the point-related stuff in an object I called scoreBoard. The issue I have is that I pass this scoreBoard to my addData function (which posts questions answers into a google sheet) it becomes undefined in my client components.

As you can see I tried turning handleFinishClick into an async and awaiting postFunction, but logging finalScore just gives me undefined. I need to use the scoreboard in another client component where I show the results to the user.

Thank you are helping, full files are attached.

1 Reply

OrientalOP
bump