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

react-router-use-location-state

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-use-location-state - npm Package Compare versions

Comparing version 2.1.5 to 2.2.0

4

dist/react-router-use-location-state.cjs.js

@@ -39,4 +39,4 @@ 'use strict';

setQueryString: function (newQueryString, _a) {
var method = _a.method;
return history[method || 'replace'](history.location.pathname + "?" + newQueryString + history.location.hash);
var _b = _a.method, method = _b === void 0 ? 'replace' : _b;
history[method](history.location.pathname + "?" + newQueryString + history.location.hash);
},

@@ -43,0 +43,0 @@ };

@@ -1,3 +0,3 @@

import { QueryStateOpts, SetQueryStateItemFn } from 'use-location-state/dist/hooks/types';
import { QueryStateOpts, SetQueryStateItemFn } from 'use-location-state';
export declare function useRouter(): import("react-router").RouteComponentProps<{}, import("react-router").StaticContext, any>;
export declare function useQueryState<T>(itemName: string, defaultValue: T, queryStateOpts?: QueryStateOpts): [T, SetQueryStateItemFn<T>];

@@ -35,4 +35,4 @@ import { useQueryState as useQueryState$1 } from 'use-location-state';

setQueryString: function (newQueryString, _a) {
var method = _a.method;
return history[method || 'replace'](history.location.pathname + "?" + newQueryString + history.location.hash);
var _b = _a.method, method = _b === void 0 ? 'replace' : _b;
history[method](history.location.pathname + "?" + newQueryString + history.location.hash);
},

@@ -39,0 +39,0 @@ };

@@ -8,9 +8,9 @@ {

"peerDependencies": {
"react": "^16.8.6",
"react": "^16.9.0",
"react-router": "^5.0.0"
},
"dependencies": {
"use-location-state": "^2.1.5"
"use-location-state": "^2.2.0"
},
"version": "2.1.5",
"version": "2.2.0",
"author": "Felix Leupold <felix@xiel.de>",

@@ -23,9 +23,9 @@ "homepage": "https://github.com/xiel/use-location-state",

"@types/react-router-dom": "^4.3.3",
"react": "^16.8.6",
"react": "^16.9.0",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"rollup": "^1.19.3",
"rollup-plugin-typescript2": "^0.22.0",
"rollup-plugin-typescript2": "^0.24.0",
"tslib": "^1.9.3",
"typescript": "3.5.1"
"typescript": "^3.6.3"
},

@@ -47,3 +47,3 @@ "files": [

},
"gitHead": "b1d83deb91cb6ff88222dd712a9ce66cd4a8cd9f"
"gitHead": "bdcea17b02e683612f00d8f01e6f81fba17bcdc1"
}

@@ -51,2 +51,12 @@ # useQueryState()

#### Push
In cases where you want the updated state to be represented as a new entry in the history, you can pass a options argument to the set function, with the method property set to `'push'`.
```javascript
setValue('a pushed value', { method: 'push' })
```
This changes the way this state change is handled when the user navigates. When the user now clicks the Back-Button, this state gets popped and the previous state is restored (instead of eg. navigating away).
### Example

@@ -53,0 +63,0 @@ ```javascript

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