Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
NOT getting updated content with every render

I'm new to Next.js. I'm facing a problem where I am not able to load my new content on the page. Next.js keeps showing the old content which I already deleted from the code. Why does prior content show?

Here is the last code which I delete but still it is showing on the source tab of chrome.

export const UploadWrapper = () => {
    // const img__isClicked = ;
    const img__isClicked = useSelector(state => state);

    useEffect(() => {
        console.log('uploadWrapper', img__isClicked);
    }, [img__isClicked])

    return (
        <section>
            <UploadDropzone />
            {(img__isClicked) ? console.log('hurray I got you') : null }
        </section>
    )
}

Here is the updated code which is not showing on the page:

export const UploadWrapper = () => {
    // const img__isClicked = ;
    const img__isClicked = useSelector(state => state.img__isClicked);

    useEffect(() => {
        console.log('uploadWrapper', img__isClicked);
    }, [img__isClicked])

    return (
      <>
        <section>
            <UploadDropzone />
        </section>
        <aside>
            {(img__isClicked === true) ? <TagsWrapper /> : null }
        </aside>
      </>
    )
}

If I wish to see fresh content then I have to restart the whole server again.

event the console is showing me

Hurray I got you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is because new render doesn't happen when you don't change the state inside the component. You could create imgClicked state like this:

export const UploadWrapper = () => {
  const [imgClicked, setImageClicked] = useState(false);
  const img__isClicked = useSelector(state => state.img__isClicked);

  useEffect(() => {
    setImageClicked(img__isClicked); // <--- This state change will trigger re-render of the component.
  }, [img__isClicked])

  return (
    <>
      {imgClicked ? <TagsWrapper /> : null}
    </>
  )
}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!