jamilharun / LAB1-FINALS

0 stars 0 forks source link

useEffect is undefined #6

Open jamilharun opened 7 months ago

jamilharun commented 7 months ago

i copied and pasted a code online then cause error to my code.

useEffect(() => {
    setTimeout(() => {
      setCount((count) => count + 1);
    }, 1000);
  });
jamilharun commented 7 months ago

fix

you didnt add useEffect in the imports

import { useEffect, useState } from 'react'