http://strml.viewdocs.io/react-router-component
React router component can dispatch based on location.pathname or location.hash if browser doesn't support History API (see hash routing).
Props can be passed through the router by setting them directly on each, or to all possible routes via a childProps hash.
Furthermore it provides advanced features like support for regex matching, full page server side rendering, multiple routers on the same page, querystring parsing, and contextual routers. Its functionality is tested using Saucelabs on all modern browsers (IE >= 9, Chrome >= 27, Firefox >= 25, Safari >= 6 and Mobile Safari on iPhone and iPad >= 6).
Its size is about 3.5kb gzipped.
Note: Special thanks to Samuel Reed
Contact Me: sam@bitmex.com
Disclaimer: The blog is created to share react components information to geek, curious ReactJS Developers.
Project Overview
Usage is as simple as just returning a configured router component from your component's render() method: <Locations>
<Location path="/" handler={MainPage} />
<Location path="/users/:username" handler={UserPage} />
<Location path="/search/*" handler={SearchPage} />
<Location path={/\/product\/([0-9]*)/} handler={ProductPage} />
</Locations>
Having routes defined as a part of your component hierarchy allows to dynamically reconfigure routing based on your application state. For example you can return a different set of allowed locations for anonymous and signed-in users.
React router component can dispatch based on location.pathname or location.hash if browser doesn't support History API (see hash routing).
Props can be passed through the router by setting them directly on each
Furthermore it provides advanced features like support for regex matching, full page server side rendering, multiple routers on the same page, querystring parsing, and contextual routers. Its functionality is tested using Saucelabs on all modern browsers (IE >= 9, Chrome >= 27, Firefox >= 25, Safari >= 6 and Mobile Safari on iPhone and iPad >= 6).
Its size is about 3.5kb gzipped.
Installation
React router component is packaged on npm: npm install react-router-component
Documentationn
- Overview and Usage
- Implementation Visualization
- Hash Routing
- Parsing Query Strings
- Server-side Rendering
- Multiple Routers
- Contextual Routers
- Capturing Clicks on Anchor Elements
- A custom Link Component
- A custom Router Component
- An Animated Router Component with ES6
- Overriding URL-Pattern's Compiler
Note: Special thanks to Samuel Reed
Contact Me: sam@bitmex.com
Disclaimer: The blog is created to share react components information to geek, curious ReactJS Developers.
Comments
Post a Comment