Skip to content

Instantly share code, notes, and snippets.

@SiegeSailor
Created April 4, 2021 06:46
Show Gist options
  • Save SiegeSailor/9c8d92eb1ad83f61a0c0481b4071d374 to your computer and use it in GitHub Desktop.
Save SiegeSailor/9c8d92eb1ad83f61a0c0481b4071d374 to your computer and use it in GitHub Desktop.
An entity for react-router-dom to pass router props to components directly under Switch.

Overview

An entity for react-router-dom to pass router props to components directly under Switch.

Example

import { RouteProps } from 'react-router-dom';

interface IEntrance extends RouteProps {}

export default function Entrance({ location }: IEntrance) {
  return <>Current Pathname: {location.pathname}.</>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment