Questions tagged [getserversideprops]
103 questions
0
votes
1 answer
Disconnect function in NEXTJS (server side)
I need to create a connected device limiter for my next.js application. When the user accesses the website, logged in, a function is executed that adds him to the list of connected users. Each user can have one device connected, only. If the person…

Hugo Rodrigues
- 3
- 2
0
votes
0 answers
401 - unauthorized call to Twitch Api from nextjs
I have this code:
const getToken = async () => {
return Axios.post(
`https://id.twitch.tv/oauth2/token?client_id=${process.env.TWITCH_ID}&client_secret=${process.env.TWITCH_SECRET}&grant_type=client_credentials`
).then((res) =>…

Skole 13
- 182
- 3
- 12
0
votes
0 answers
infinite scroll using getServerSideProps in nextjs
I have a catalog page which presents some products and filters. I use getServerSideProps to get data and pre-render the page. Here I want to use infinite scroll. Is there any way to retrieve the pageNumber in getServerSideProps without having the…

Ghassen Chaar
- 21
- 4
0
votes
0 answers
Fetch data at component level and have it prerendered/ssr nextjs
I'm working with Nextjs for the first time.
I'm trying to create multiple layouts which will consist on a

Jaypee
- 1,272
- 5
- 17
- 37
0
votes
1 answer
In NextJs how to change getServerSideProps with change event
Here I am trying to change products data according to category,
I have an index page and two components named Products and Categories. At first I am fetching all products by getServerSideProps then I need to fetch category wise products when user…

Moshiur
- 659
- 6
- 22
0
votes
0 answers
Next.js: getServerSideProps with react-redux and redux-persist
I am having a problem with my dispatchers not firing the reducer and not updating the state :
Figured I am not levering getServerSideProps correctly as the docs from next suggest, as well as this blog post.
So before I go down a rabbit hole:
The…

Antonio Pavicevac-Ortiz
- 7,239
- 17
- 68
- 141
-1
votes
1 answer
Call getServerSideProps with parameters from FE in Nextjs
I want to achieve the following
FE input a string and press translate button
pass the value of that string to the getServerSideProps in the Home (parent) component
use that value to call fetchDBData() in order to use the findOne method in…

shawngsg
- 9
- 2
-1
votes
0 answers
Using getStaticProps and getServerSideProps to make authenticated requests to django api
I have a next js application for the frontend and a django REST framework api on the backend. I am using jwt token authentication for my backend using django Simple JWT. Most of my api views are protected by authorization bearer header…

Kevin
- 1
-1
votes
0 answers
Next Js abort axios in get server side props on routing
is there anyone know what happened to axios request inside next js get serverside props on page route, did it abort the request or still running in background, and how to abort all axios request in get serverside props when page route, thank…
-1
votes
2 answers
I did not get data from the api. I need fetch data from API
import { GetServerSideProps, NextPage } from 'next';
import Image from 'next/image';
import React from 'react';
import photo from '../../assets/photo.jpg';
type Products = {
data?: {
id: number;
title: string;
body: string;
…

S M Fahim Hossen
- 21
- 3
-1
votes
1 answer
Get some html form data (or Object) in getServerSideProps() in NEXTJS
I need to get some form data submitted from a NextJS page to another (server side rendered) page in it getServerSideProps function. basically the api that i need call in the getServerSideProps() needs those data to be passed. thought of using…

Vivek Tiwari
- 27
- 4
-1
votes
1 answer
simple getServerSideProps doesn't working
I'm trying to use getServerSideProps nextJS function but it just doesn't work. Just return undefined for my props...
export async function GetServerSideProps(context){
var test = 3
return {
props: {
test
}
…

Renato
- 121
- 1
- 8
-2
votes
1 answer
How to handle dynamic authorization-based content in Next.js with getStaticProps or getServerSideProps?
I am building a Next.js application where I need to fetch and display content based on the user's authorization status. I initially used getStaticProps to fetch and cache the content at build time. However, I realized that the cached content is…

János
- 32,867
- 38
- 193
- 353