I'm not quite getting this. I scoured through stackoverflow and github, and one of the solutions I tried was to add a generic but I'm getting this error Expected 0 type arguments, but got 1. under useLocation<LocationState> Here is my code below. The problem I'm having is setting types to {searchvalue} but its an unknown type. Any help would be greatly appreciated.
import React from "react";
import { useLocation } from "react-router-dom";
interface SearchResultsProps {}
interface LocationState {
serachValue: string
}
export const SearchResults: React.FC<SearchResultsProps> = ({}) => {
const location = useLocation<LocationState>();
const {searchValue} = location.state
return <div>Results Page</div>;