记一次Typescript+react的match的坑

 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
posted @ 2020-01-20 11:46  豪-Sir  阅读(1112)  评论(0)    收藏  举报

载入天数...载入时分秒...