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

react-helmet-async

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-helmet-async - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "react-helmet-async",
"version": "0.0.2",
"version": "0.0.3",
"description": "Thread-safe Helmet for React 16+ and friends",

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

# react-helmet-async
This package is a fork of [React Helmet](https://github.com/nfl/react-helmet).
This package is a fork of [React Helmet](https://github.com/nfl/react-helmet).
`<Helmet>` usage is synonymous, but SSR is radically different.
`react-helmet` relies on `react-side-effect`, which is not thread-safe. If you are doing anything asynchronous on the server,
`react-helmet` relies on `react-side-effect`, which is not thread-safe. If you are doing anything asynchronous on the server,
you need Helmet to to encapsulate data on a per-request basis, this package does just that.

@@ -11,7 +11,7 @@

The main way that this package differs from `react-helmet` is that it requires using a Provider to encapsulate Helmet state for your React
The main way that this package differs from `react-helmet` is that it requires using a Provider to encapsulate Helmet state for your React
tree. If you use libraries like Redux or Apollo, you are already familiar with this paradigm:
```javascript
import HelmetProvider from 'react-helmet-async/lib/Provider';
import Helmet, { HelmetProvider } from 'react-helmet-async';

@@ -31,3 +31,3 @@ const app = (

On the server, we will no longer use static methods to extract state. `react-side-effect`
On the server, we will no longer use static methods to extract state. `react-side-effect`
exposed a `.rewind()` method, which Helmet used when calling `Helmet.renderStatic()`. Instead, we are going

@@ -37,3 +37,3 @@ to pass a `context` prop to `HelmetProvider`, which will hold our state specific to each request.

```javascript
import HelmetProvider from 'react-helmet-async/lib/Provider';
import { HelmetProvider } from 'react-helmet-async';

@@ -61,3 +61,3 @@ const helmetContext = {};

This package only works with streaming if your `<head>` data is output outside of `renderToNodeStream()`.
This package only works with streaming if your `<head>` data is output outside of `renderToNodeStream()`.
This is possible if your data hydration method already parses your React tree. Example:

@@ -69,4 +69,3 @@

import { getDataFromTree } from 'react-apollo';
import Helmet from 'react-helmet-async';
import HelmetProvider from 'react-helmet-async/lib/Provider';
import Helmet, { HelmetProvider } from 'react-helmet-async';
import template from 'server/template';

@@ -109,2 +108,2 @@

.pipe(res);
```
```
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