react-routsy
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -6,3 +6,3 @@ var React = require('react'); | ||
var clone = require('lodash.clone'); | ||
var pluck = require('lodash.pluck'); | ||
var pluck = require('pluck'); | ||
@@ -109,3 +109,3 @@ var DOM = React.DOM; | ||
var keys = pluck(parsedPath.slice(1), 'name'); | ||
var keys = pluck('name')(parsedPath.slice(1)); | ||
var values = this.parseHash().match(pathRegex).slice(1); | ||
@@ -112,0 +112,0 @@ |
{ | ||
"name": "react-routsy", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Tiny React component for routing on individual pages", | ||
@@ -13,5 +13,5 @@ "main": "index.js", | ||
"lodash.clone": "^3.0.1", | ||
"lodash.pluck": "^3.1.1", | ||
"object-assign": "^2.0.0", | ||
"path-to-regexp": "^1.1.1", | ||
"pluck": "0.0.4", | ||
"react": "^0.13.3", | ||
@@ -18,0 +18,0 @@ "zip-object": "^0.1.0" |
@@ -12,3 +12,3 @@ # react-routsy | ||
```html | ||
```js | ||
import React, {Component, render} from 'react'; | ||
@@ -18,28 +18,28 @@ import {Route, navigateTo} from 'react-routsy'; | ||
class CustomComponent extends Component { | ||
go () { | ||
navigateTo('/do-this'); | ||
} | ||
render () { | ||
return ( | ||
<div> | ||
<Route path='/do-this'> | ||
<div>This gets rendered only when the path matches</div> | ||
</Route> | ||
<Route path='/users/:id'> | ||
<p onClick={this.go.bind(this)}> | ||
This is renedered with id available on {this.props.router.params.id}. | ||
This is also available on child component props. | ||
</p> | ||
</Route> | ||
<Route path='/'> | ||
This gets rendered when the hash is #/ or # | ||
</Route> | ||
</div> | ||
); | ||
} | ||
render () { | ||
return ( | ||
<div> | ||
<Route path='/do-this'> | ||
<div>This gets rendered only when the path matches</div> | ||
</Route> | ||
<Route path='/users/:id'> | ||
<p onClick={this.go.bind(this)}> | ||
This is renedered with id available on {this.props.router.params.id}. | ||
This is also available on child component props. | ||
</p> | ||
</Route> | ||
<Route path='/'> | ||
This gets rendered when the hash is #/ or # | ||
</Route> | ||
</div> | ||
); | ||
} | ||
} | ||
@@ -64,10 +64,10 @@ | ||
```html | ||
```js | ||
let paramsMap = { | ||
id: 'somePropName' | ||
id: 'somePropName' | ||
}; | ||
<Route path="/users/:id" paramsAsProps={paramsMap}> | ||
<CustomComponent /> | ||
<CustomComponent /> | ||
</Route> | ||
@@ -74,0 +74,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11263
+ Addedpluck@0.0.4
+ Addedpluck@0.0.4(transitive)
- Removedlodash.pluck@^3.1.1
- Removedlodash._arraymap@3.0.0(transitive)
- Removedlodash._basecallback@3.3.1(transitive)
- Removedlodash._baseeach@3.0.4(transitive)
- Removedlodash._baseget@3.7.2(transitive)
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._topath@3.8.1(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.map@3.1.4(transitive)
- Removedlodash.pairs@3.0.1(transitive)
- Removedlodash.pluck@3.1.2(transitive)