Relative Content

Tag Archive for next.js

Server component toggle stops working when trying to render a client element

//types/types.ts export interface Component { id: string; category: Category; tag: Tag; name: string; desc: string; image: Image; } export interface Image { id: string; url: string; } export interface Category { slug: string; title: string; } export interface Tag { slug: string; title: string; } //Filter/filter.tsx “use client”; import { Button } from “@/components/ui/button”; import […]

I am having issues with the checkout, how to authorize API?

enter image description hereI am getting this error on the production side. But in VS Code I am not having this problem everything is working, when I push the site to production I am having the error. I am logged but when I click check out it is asking me to log in again.

NextJS 14 redirect from server file

I have a NextJS 14 app that uses an agent.ts file for defining and handling API interactions with Axios. In this, I want to handle 401, 403, 404 and 500 status codes in a common way across my application; for example, redirecting to the login page.

Nextjs Deployment to linux server

We’ve deployed nextjs app to linux server, and we configured httpd.conf file to point the site to
build directory , as build folder doesnt have index.html we are not sure abt how we can point site to build folder

Are all descendants of Client Component client components? Nextjs app router

the doc says that “use client” is a boundary between server and client.
Does it mean once i use “use client” then all descendants are client components?
when I use framer-motion,I can’t get benefit of server component, right?
you guys how do you think about it? or have some solution or I’m wrong?

NEXT router.back() –> pass data

I have an understanding issue of how to use next/navigation router and passing data while using router.back().
I have a page where user can create a booking on route /booking/new. In that form they need to select from a list of existing customers. If intended customer is not existing yet he can create a new customer by clicking on “new” which brings him to the route /customer/new. Now after submitting the customer form I’m sending him back by router.back(), because this page might be also opened from other places.
How is it possible now to pass the created customer ID to the last page (in this case /bookings/new) to prefill the selection component with that customer?