1 import React from "react"; 2 import { match } from 'react-router-dom' 3 4 interface Props { 5 match: match<{id?: string}> 6 } 7 8 const Rdx: React.FC<Props> = ({ match }: Props) => { 9 const id = match.params.id; 10 return ( 11 <div> 12 我是Rdx页面,id是 {id} 13 </div> 14 ); 15 } 16 export default Rdx
来源:https://www.cnblogs.com/ywenhao/p/12217334.html