Relative Content

Tag Archive for javascriptreactjsnext.jsfrontend

getStaticProps not passing static JSON data to component

I have a static JSON file for now, but I plan on fetching API data in the future. Since I’m new to Next.js, I’m testing out some simple code. When I run my project, I see that the [{"default":"data"}] default parameter value is displayed, but not the testData.json file. I know getStaticProps isn’t necessary in this case, but I would like to learn how to use it. Any ideas what went wrong? 🙁

getStaticProps not passing static JSON data to component

I have a static JSON file for now, but I plan on fetching API data in the future. Since I’m new to Next.js, I’m testing out some simple code. When I run my project, I see that the [{"default":"data"}] default parameter value is displayed, but not the testData.json file. I know getStaticProps isn’t necessary in this case, but I would like to learn how to use it. Any ideas what went wrong? 🙁

Navigate and Login in NextJS

I have a form, username, password and a link. the acction when I click the link is using the username and password to login a website(EG: https://domaina.com/login) and then navigate to another page in web site (EG: https://domaina.com/toppage). All the action happen in new tab in browser. How i can do that? Thank you