Hello I'm trying to import useLocation Hook from react-router-dom "typescript" I can't find it
as per React Router Documentation I'm pretty sure it exists.
Yet in typescript it keeps telling me there is not exported member called useLocation
This is how I import it:
import { useLocation } from 'react-router-dom';
And this is the error I get:
Module '"../../node_modules/@types/react-router-dom"' has no exported member 'useLocation'.ts(2305)
This is a typescript parsing error meaning the error is thrown by the package @types/react-router-dom
and not the package react-router-dom
, make sure you update and reinstall both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With