Socket
Socket
Sign inDemoInstall

@shopify/react-network

Package Overview
Dependencies
Maintainers
13
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-network - npm Package Compare versions

Comparing version 3.5.2-async-text-cleanup-beta.2 to 3.5.2

4

CHANGELOG.md

@@ -14,3 +14,3 @@ # Changelog

- Fixes bug where empty cookies are still being set
- Fixes bug where empty cookies are still being set [#1517](https://github.com/Shopify/quilt/pull/1517)

@@ -21,3 +21,3 @@ ## [3.5.0] - 2020-06-16

- Do not set `set-cookie` headers for incoming request cookies
- Do not set `set-cookie` headers for incoming request cookies [#1515](https://github.com/Shopify/quilt/pull/1515)

@@ -24,0 +24,0 @@ ## [3.4.0] - 2020-06-10

{
"name": "@shopify/react-network",
"version": "3.5.2-async-text-cleanup-beta.2",
"version": "3.5.2",
"license": "MIT",

@@ -27,6 +27,6 @@ "description": "A collection of components that allow you to set common HTTP headers from within your React application",

"dependencies": {
"@shopify/network": "^1.4.7",
"@shopify/network": "^1.5.0",
"@shopify/react-effect": "^3.2.12",
"@shopify/react-hooks": "^1.10.1",
"@shopify/react-universal-provider": "^1.1.19-async-text-cleanup-beta.2",
"@shopify/react-universal-provider": "^1.1.18",
"@types/accept-language-parser": "1.5.0",

@@ -33,0 +33,0 @@ "@types/cookie": "^0.3.3",

@@ -91,4 +91,6 @@ # `@shopify/react-network`

This library allows you to read from request headers, and set response headers. To set a header, call the `useHeader()` hook, which accepts the name of a header and the desired value. `useRequestHeader()`, on the other hand, gives you access to a specified request header (see `NetworkUniversalProvider` below for usage on client-side renders).
This library allows you to read from request headers, and set response headers. To set a header, call the `useHeader()` hook, which accepts the name of a header and the desired value. `useRequestHeader()`, on the other hand, gives you access to a specified request header.
**Note:** calling `useRequestHeader` on client-side renders will give you `undefined`, since we only have access to the request context on the server. To remedy this, wrap your app in a `NetworkUniversalProvider` (see below for more details).
```tsx

@@ -108,2 +110,4 @@ import {useHeader, useRequestHeader} from '@shopify/react-network';

**Note:** `useAcceptLanguage` calls `useRequestHeader`, so the constraints on client-side renders apply here too. Wrap your app in a `NetworkUniversalProvider` and pass in `[Header.AcceptLanguage]` to the `headers` prop in order to call `useAcceptLanguage` on subsequent client-side renders.
```tsx

@@ -110,0 +114,0 @@ import {useAcceptLanguage} from '@shopify/react-network';

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