1. <Link>
在应用程序中提供声明性的、可访问的导航
import { Link } from 'react-router-dom'
<Link to="/about">About</Link>
1.1. to: string
链接到的路径名或位置。
<Link to="/courses"/>
1.2. to: object
链接到的位置。
<Link to={{
pathname: '/courses',
search: '?sort=name',
hash: '#the-hash',
state: { fromDashboard: true }
}}/>
1.3. replace: bool
当为true时,单击该链接将替代history堆栈中的当前条目,而不是添加一个新条目。
<Link to="/courses" replace />