#beta-116 - Need help creating (frontend) pages

11 messages · Page 1 of 1 (latest)

sour sun
#

Hey so I have this repo that was previously on beta-109 and things worked fine. Trying to update though, didn't see this in breaking changes. I have a page in src/app/(frontend) that's complaining about properties I'm trying to pass into it.

Does anything look obviously wrong? Screenshots below. I did try passing in Args as a promise but that doesn't seem right either (I get different but similar errors)

whole helmBOT
lost berry
sour sun
#

@lost berry I'm using it to hit an API on page load with a useEffect

useEffect(() => {
    const checkIntakeForm = async () => {
      const res = await fetch(`/api/intake?where[client][equals]=${clientId}`)
      const data = await res.json()
... some more code ...
}
lost berry
#

where do you expect it to come from?

sour sun
#

@lost berry The flow is button on app --> api/send-email/route.ts --> /client-intake/[id]/page.tsx

lost berry
sour sun
#

@lost berry Hmm so this might boil down to a react-based question. I didn't construct this so I am kinda working backwards. I setup the params what looks like correctly - then, I know in v3 we expect them to be async. So I changed the id to be async and got a few other errors (process shown in screenshots)

lost berry
#

Pages are server components by default and you need to create client subcomponents that hosts the actual content

sour sun
#

For others reading - this is what I ended up doing. I was able to get the ID param inside this IntakeForm component by using nextJs's useParams function :) thank you tyteen4a03