import {useParams,useSearchParams,useLocation} from 'react-router-dom';
function Detail() {
    let {productId} = useParams();
    let [searchParams] = useSearchParams();
    let {state} = useLocation();
    return (
        <>
            <h1>详情</h1>
            <p>当前浏览商品的ID是:{productId || searchParams.get('productId') || state.productId}</p>
        </>
    )
}
export default Detail;