do we need to put Link inside react router code example
Example 1: react router Link does work
import { Link } from 'react-router-dom';
Example 2: how to link to a different component in reactjs without react router
const showComponent = (route, component) => {
return window.location.pathname === route ? component : null
}