How do I use my axios call for getStaticPaths and getStaticProps #14745
Unanswered
antonioOrtiz
asked this question in
Help
Replies: 1 comment
-
You will have to move the API call in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a component which renders the response (Successfully verified, Has been verified already, and this token has expired) from making a call to my server from clicking a link in a Account Verification email I sent after registering.
At very rare instances the UI would render, but the content for it wouldn't, so I was reading the Next docs regarding getStaticProps and getStaticPaths and figured pre-rendering is what i need \o/
Right now I am using the
useEffect
hook in the component:But what I want to do now is fill this bad-boy with pre-rendered data,
I'm stuck at how to approach it because on the component level as you can see I've created some hooks which are reacting (ha!) to the axios call. I am not sure how to wire the
getStaticProps
Reading the docs it feels like you need to usegetStaticPaths
with it....Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions