import React, { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function ProductOrderDetail() {
  // 路由钩子
  const location = useLocation();
  // 接收参数
  const { id } = location.state;
  // componentDidMount
  useEffect(() => {
    console.log('拿到的id是 --->', id);
  }, [id]);
  return (
    <div>
      <h2>ProductOrderDetail</h2>
      <h3>{id}</h3>
    </div>
  );
}

export default ProductOrderDetail;
