I having some problems when using react-router-dom hooks + TypeScript.
Trying to access some state property would give an error saying that it doesn't exist
Refer to:
One of the workarounds that I had to do in order to continue development, was to cast it to any
const location = useLocation() as any;
How can I pass a valid interface to the useLocation generic in order to access state properties without warnings?
useDidMount(() => {
if (location.state?.newTransactions) {
scroll.scrollToBottom();
}
});
