skip to Main Content

Reactjs – When does re-rendering actually happens?

Code: import { useState } from 'react'; export default function Counter() { const [number, setNumber] = useState(0); return ( <> <h1>{number}</h1> <button onClick={() => { setNumber(number + 1); setTimeout(()=>setNumber(number + 1),2000); setTimeout(()=>setNumber(number + 1),5000); }}>+3</button> </> ) } I went…

VIEW QUESTION

Javascript – params is undefined in Nextjs?

I have the below function in app/api/hello/[slug]/route.ts when I console log I get undefined . why ??? app/api/hello/[slug]/route.ts export async function GET({ params }: any) { console.log(params); } log - wait compiling /api/hello/[slug]/route (client and server)... - event compiled successfully…

VIEW QUESTION
Back To Top
Search