New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-router-location-aware-transitions

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-location-aware-transitions - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

dist/child.js

@@ -219,3 +219,3 @@ 'use strict';

path: _propTypes2.default.string,
children: _propTypes2.default.node.isRequired,
children: _propTypes2.default.any.isRequired,
location: _propTypes2.default.object.isRequired,

@@ -222,0 +222,0 @@ className: _propTypes2.default.string,

{
"name": "react-router-location-aware-transitions",
"version": "1.0.2",
"version": "1.0.3",
"description": "Power contextual location aware react router transitions",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

# react-router-location-aware-transitions
Power contextual location aware react router transitions
## Getting started
```bash
npm install react-router-location-aware-transitions --save
```
## Example
### Decorating react router Route's
```jsx
import React from 'react'
import { Route } from 'react-router-dom'
import LocationAwareTransitions from 'react-router-location-aware-transitions'
import styles from './styles.scss'
export default class App extends React.Component {
render() {
return (
<div>
<LocationAwareTransitions.Conductor onLocationWillChange={onLocationWillChange}>
<TransitionRoute component={require('./components/a')} path='/a' />
<TransitionRoute component={require('./components/b')} path='/b' />
<TransitionRoute component={require('./components/c')} path='/c' />
</LocationAwareTransitions.Conductor>
</div>
)
}
}
function TransitionRoute({ component, path, ...props }) {
return (
<Route path={path} {...props} children={childProps =>
<LocationAwareTransitions.Child {...childProps} path={path} className={styles.transitionChild}>
{component}
</LocationAwareTransitions.Child>
} />
)
}
TransitionRoute.propTypes = {
component: PropTypes.any.isRequired,
path: PropTypes.string
}
function onLocationWillChange(nextProps, currentProps) {
// optional logic here
// TODO: add real use-case example for this.
return true
}
```
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