Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-routsy

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-routsy - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -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 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc