score:3

Accepted answer

Your import in usePrevious hooks file is incorrect. useRef and useEffect should be import from 'react' and not React;

import { useRef, useEffect} from "react"

Related Query

More Query from same tag