/something/detail?term=123 과 같이
url 쿼리가 포함된 주소에서 query값 가져오기
import { useLocation } from 'react-router-dom';
const location = useLocation();
const [_, query] = location.search.split('?term=');
npm i query-string
const queryString = require('query-string');
console.log(location.search);
//=> '?foo=bar'
const parsed = queryString.parse(location.search);
console.log(parsed);
//=> {foo: 'bar'}