How to combine the data of two state into third state in Next js
I am using useState to set a state I have collected data in two different states (that are text and inputs ) now I want to add both states into a third state (that is alldata)
How to manage user redirection after logout and login in Next.js based on previous route?
After Logout: When a user logs out, especially from a specific page such as /users
, they should be redirected to the dashboard (/dashboard
) upon logging back in, regardless of the previous page they were on.
fetch doesn’t work in getServerSideProps but it works in client side
I have an endpoint that I fetch in client side in a page of Next JS it works,
But once I use the same endpoint with everything same it doesnt work
I got this error
errno: -3008,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘api.exemple.fr’
No problem in the implementation,
How can I optimize NextJS first load pages?
I am using Nextjs 13.5 with Pages structure in building a large scale application that consists of many complix logic and components.
TypeError: Cannot read properties of null (reading ‘fn’)
Error:
When trying to compile the Next.js project, the following error occurs:
Next.js not generating a project
I am trying to build a project and in the tutorial they tell me to start with this