Skip to content
Advertisement

Tag: next.js

How to get query parameters in _app?

My environment: React.js + Next.js I need query parameters in app.jsx. When I wrote Chrome console prints queries well, but on terminal the query is empty. Is there any way to get query in app.jsx? Answer Well you can use useRouter to get the query parameters. The query parameters are available only when you making a request to the Next.js

Import SASS variables into Material UI theme with NextJS

In my project I have the following files: materialTheme.ts palette.scss I want to de-duplicate these files. I thought I could import the variables from palette.scss into materialTheme.ts but Next.JS throws an error about only importing global CSS into _app.tsx materialTheme.ts (not working) Is there any way I can make NextJS ignore this error just for materialTheme.ts and correctly import the

How can I get token from the URL in Nextjs / React App?

I am working on an API based project. I have my front-end interface with React and Next.js and the API back-end builds with Laravel. I have a front-end page with a token in URL which I have made in my Laravel back-end to identify the user. Question: How can I get the token from URL in client-side for sending it

how to cleanly handle errors in nextjs getStaticProps

I’m very busy at the moment with building my first Next.JS application (Next and Strapi). Now everything is working but i’m curious about what the best way is to implement error handling when using getStaticProps. I tried a few things myself (passing multiple props etc, but that all didn’t work (typical unserialized JSON error). The thing I want to achieve

How to switch input radio button checked every 3 seconds?

I am trying to switch between input radio button checked every 3 second in Next.js, and it is switching from case0 to case1 and case1 to case2 but not case2 to case0. I have intermediate level of knowledge in React and Next.js. Answer As @Phil mentioned in his answer, you should wrap the setInterval logic inside a useEffect to avoid

Temporary disable Next.js pages on build

There are SSR-related problems with several pages in Next.js project that results in errors on npm run build and prevent the project from being built: For example, bar: As a quick fix, it may be convenient to just not build bar/*.* pages and make routes unavailable. Can pages be ignored on Next.js build without physically changing or removing page component

Advertisement