Passing data from a component to children inside a layout
Going through the tutorial for NextJS, their provided the following Layout
React JS Stop setState batching in async function
I have the react client component, it’s a part of a next.js app, this component is a simple form that sends it’s formData to a next.js server action through an async function that will do the following steps:
NextJS Hydration Error beacuse of `useMediaQuery` usage
I have a dynamic page like this in nextjs:
How to use relative path in Next Image?
I want to fetch corresponding product image on each dynamic route in my NextJS project, like this:
Can react manipulate content from a CMS?
I have a CMS and Next.js (react). My content is created using the CMS and Next.js pulls the content HTML in using SSR and then CSR. The content is put to page with the usual horrible:
React resize event listener not updating state with useCallBack
I don’t know if I’m miss understanding what useCallBack is for or if I’m doing something wrong.
How does Next.js decide between server and client execution, especially during routing?
I’ve been reading through Next.js documentation on rendering modes, including Server Components, Server Actions, and data fetching best practices. My understanding is that Next.js code can run in three contexts:
How does Next.js decide between server and client execution, especially during routing?
I’ve been reading through Next.js documentation on rendering modes, including Server Components, Server Actions, and data fetching best practices. My understanding is that Next.js code can run in three contexts:
The router.push function is not working in the login submit handler
I’m using the Next.js App Router and have implemented middleware to check for the presence of an access token. If a user tries to access any page other than the root (/) or login-related pages without a token, I’m adding the returnURL to the search params so they can be redirected back to that page after logging in. However, this approach hasn’t been working as expected. For handling the login process, I’m using react-hook-form along with tanstack-query’s useMutation.
Why useEffect running twice and how to handle it well in React?
I have a counter and a console.log()
in an useEffect
to log every change in my state, but the useEffect
is getting called two times on mount. I am using React 18. Here is a CodeSandbox of my project and the code below: