Skip to content

Tag: next.js

how to pass an object as a prop in nextjs

I cant quite figure out how I am supposed to pass an object as a prop when using useState in Next JS. I have a lorem ipsum generator that I created in javascript functions. I have a component called Paragraphs that houses it. I need to pass in two properties, a number of paragraphs. a sentence length. The par…

404 on page refresh in NextJS with p5.js

I’m using the react-p5 library for generating PerlinNoise wave animation in my about page. When I use the p5 on any page it returns a 404 page, but if click back to the home page and open about.js using the link it will work. After refresh, it won’t work. Everything works if I remove the p5 compon…

Best way to include reusable SVG in React

I am including SVG as reusable component on my react application. Sample of SVG component is as follows On page level, I am importing IconComponent and reusing it. Is there any other best way to include reusable SVGs in React pages which improves performance/page load? Answer 1. SVG with webpack command line …

Getting OAuthCallbackError with nextjs Auth

I am trying to make a spotify analysis app that would analyse your Spotify data. But I am getting this error on authorization. Here is my auth file. this is my middleware this is my login.js It would be really great if someone could help me out here. Everytime I am trying to login,it’s throwing me this …

How to list out NextJS router param array

I have a NextJS catch all route which pulls in And retrieves all the parameters: If I log the params value I see all the URL path elements in the console. I would like to repeat out all the params values in an unordered list: But this outputs nothing. There are no elements displayed. How can I get this to

Next-Auth Signout within jwt callback

If a user is signed into the app between app upgrades, then I want to sign out the user the next time they visit. I am pulling the version in from the package.json and storing it in the jwt/session to have for comparison of which version the user authenticated from and what version is now running. This works,…