type of page props nextjs
Answered
American black bear posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
American black bearOP
Hello everyone,
is there a better way to do the following, eg with a built in props. I can't find one
is there a better way to do the following, eg with a built in props. I can't find one
export type ExercisePageProps = {
params: { id?: Exercise["id"] };
searchParams: { from?: string; to?: string };
}; // surely there is a built in props for that
const Page = async (unsafeProps: ExercisePageProps) => {
return (...)
}
Answered by risky
Nextjs currently doesn't have a method for knowing the params (for dynamic routes)... we have a community one tho https://discord.com/channels/752553802359505017/1159366767358005278/1159366839298691084
3 Replies
![Avatar](https://cdn.discordapp.com/avatars/657067112434499595/aff4eeb34922ca980b0d5fbb5bc60c21.webp?size=256)
risky
Nextjs currently doesn't have a method for knowing the params (for dynamic routes)... we have a community one tho https://discord.com/channels/752553802359505017/1159366767358005278/1159366839298691084
Answer
![Avatar](https://cdn.discordapp.com/avatars/657067112434499595/aff4eeb34922ca980b0d5fbb5bc60c21.webp?size=256)
risky
You would still have to type searchparams as know one knows what it is
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
American black bearOP
yeah that makes sense. Thanks for your help 🙌