記一次Typescript+react的match的坑

import React from "react";
import { match } from 'react-router-dom'

interface Props {
    match: match<{id?: string}>
}

const Rdx: React.FC<Props> = ({ match }: Props) => {
    const id = match.params.id;
    return (
        <div>
            我是Rdx頁面,id是 {id}
        </div>
    );
}
export default Rdx
相關文章
相關標籤/搜索