提供 11 个示例快速使用最新版本(V4)react-router.
React Router 已经到 Version 4 的 Beta 版本,新的版本有了很大的改变,提供了 react-router-dom 和 react-router-native 两个包单独使用,并且新增了很多功能丰富的路由组件,写法也更加丰富和灵活了,这也正是所倡导的可组装性和声明式两大特点的表现。以下是 Repo 中所提供的一些实例代码。
import BasicExample from './components/BasicExample'
import ParamsExample from './components/ParamsExample'
import AuthExample from './components/AuthExample'
import CustomLinkExample from './components/CustomLinkExample'
import PreventingTransitionsExample from './components/PreventingTransitionsExample'
import NoMatchExample from './components/NoMatchExample'
import RecursiveExample from './components/RecursiveExample'
import SidebarExample from './components/SidebarExample'
import AnimationExample from './components/AnimationExample'
import AmbiguousExample from './components/AmbiguousExample'
import RouteConfigExample from './components/RouteConfigExample'