Skip to main content

Posts

Showing posts with the label React Router

Declarative router component for React.

http://strml.viewdocs.io/react-router-component 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 , or to all possible routes via a childPro