React Router Provider
Provide router or location as property to any child component. You can use it as decorator too.
Install
npm install react-router-provider
Support us
Star this project on GitHub.
Usage provideRouter
Decorator
;; @provideRouter { const router = thispropsrouter; const isActive = router; return <div>routerisActive</div> ; }``` ### Function ```js;; { const router = thispropsrouter; const isActive = router; return <div>routerisActive</div> ; } Example;``` ## Usage provideLocation ### Decorator ````jsimport React, { Component } from 'react';import { provideLocation } from 'react-router-provider'; @provideLocationexport default class Example extends Component { render() { const location = this.props.location; return ( <div>{location.query}</div> ); }}``` ### Function ```jsimport React, { Component } from 'react';import { provideLocation } from 'react-router-provider'; class Example extends Component { render() { const location = this.props.location; return ( <div>{location.query}</div> ); }} export default provideLocation(Example);``` ## Try our other React components - Translate your great project react-translate-makerhttps://github.com/CherrySoftware/react-translate-maker) - Forms react-form-controlledhttps://github.com/seeden/react-form-controlled) - Google AdSense via Google Publisher Tag react-google-publisher-taghttps://github.com/seeden/react-google-publisher-tag) # Support us Star this project on GitHubgithub-url ## Credits Zlatko Fedorhttp://github.com/seeden) ## License The MIT 2016 Zlatko Fedor zlatkofedor@cherrysrocom