Created
August 17, 2020 23:45
-
-
Save dschinkel/c2000ffed6bb868fb41cb589131473b7 to your computer and use it in GitHub Desktop.
Cookebook - React/TypeScript - React Router via Functional Component (unverified)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//source: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/17355 | |
import { RouteComponentProps } from 'react-router-dom'; | |
type MyProps = RouteComponentProps<{ id?: string }> | |
const CoolThing: React.FC<MyProps> = ({ match }) => { | |
const id = match.params.id; | |
return ( | |
<div>Hopefully that helps!</div> | |
); | |
} | |
export default CoolThing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment