I want to access user id and date from the url to function but because this is not the default class
http://localhost:3000/update?user=66&date=2022-06-27&tab=user
const getuserData = (props) => {
console.log(props.user);
console.log(props.date);
};
i have used useLocation
const Tracker = (props) => {
const search = useLocation().search;
console.log(URI.parseQuery(search));
console.log(URI.parseQuery(search)) is returning in cosole the following {user: '66', date: '2022-06-28', tab: 'diet'}
i want to pass user & date into getuserData
full code i have given in sandbox for refernce https://codesandbox.io/s/cool-lalande-87jbpq?file=/src/App.js