Next.js Discord

Discord Forum

Redirect() and GetStaticProps()

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Hey everybody! Is it possible to get information in GetStaticProps() that the page was generated via call of Redirect()?

4 Replies

@Cape lion Hey everybody! Is it possible to get information in GetStaticProps() that the page was generated via call of Redirect()?
getstaticprops is run at build time so can only have the information known at build time. so no
Cape lionOP
is it possible to send a query parameter when revalidating and then get query parameter in getstaticprops? or is that also not possible?
American black bear
nah, you can't
@Cape lion is it possible to send a query parameter when revalidating and then get query parameter in getstaticprops? or is that also not possible?
It’s static, meaning it can’t change over time. You can’t expect it to know things that will only be known at request time (the future), query parameter is one of those.