项目作者: MarkRabey

项目描述 :
Minimal Routing for React.
高级语言: JavaScript
项目地址: git://github.com/MarkRabey/react-roadway.git
创建时间: 2017-06-21T15:01:23Z
项目社区:https://github.com/MarkRabey/react-roadway

开源协议:MIT License

下载


React Roadway

Minimal Routing for React

Installation

  1. npm install react-roadway --save

Examples

  1. const Home = createRoute((props) => (
  2. <div>
  3. <h1>Home</h1>
  4. </div>
  5. ));
  6. const About = createRoute((props) => (
  7. <div>
  8. <h1>About</h1>
  9. </div>
  10. ));
  11. const App = createRouter(() => (
  12. <div>
  13. <nav>
  14. <ul>
  15. <li><Link href="/">Home</Link></li>
  16. <li><Link href="/about">About</Link></li>
  17. </ul>
  18. </nav>
  19. <Home match="/" ></Home>
  20. <About match="/about" ></About>
  21. </div>
  22. ));
  23. render(<App ></App>);

Contributor Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

MIT Copyright (c) 2017 Opentrace