How to use the react-helmet-async.HelmetProvider.canUseDOM function in react-helmet-async

To help you get started, we’ve selected a few react-helmet-async examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xing / hops / packages / template-graphql / src / home / spec / index.spec.js View on Github external
import React from 'react';
import renderer from 'react-test-renderer';
import { HelmetProvider } from 'react-helmet-async';
import { Home } from '../';

HelmetProvider.canUseDOM = false;

it('renders loading state correctly', () => {
  const tree = renderer
    .create(
      <HelmetProvider>
        <Home data={{ loading: true }} />
      </HelmetProvider>
    )
    .toJSON();
  expect(tree).toMatchSnapshot();
});

it('renders loaded state correctly', () => {
  const data = {
    loading: false,
    github: {
github xing / hops / packages / template-redux / src / home / spec / index.spec.js View on Github external
import React from 'react';
import renderer from 'react-test-renderer';
import { HelmetProvider } from 'react-helmet-async';
import Home from '../';

HelmetProvider.canUseDOM = false;

it('renders correctly', () => {
  const tree = renderer
    .create(
      <HelmetProvider>
        <Home />
      </HelmetProvider>
    )
    .toJSON();
  expect(tree).toMatchSnapshot();
});
github xing / hops / packages / template-react / src / home / spec / index.spec.js View on Github external
import React from 'react';
import renderer from 'react-test-renderer';
import { HelmetProvider } from 'react-helmet-async';
import Home from '../';

HelmetProvider.canUseDOM = false;

it('renders correctly', () => {
  const tree = renderer
    .create(
      <HelmetProvider>
        <Home />
      </HelmetProvider>
    )
    .toJSON();
  expect(tree).toMatchSnapshot();
});
github sharetribe / ftw-daily / src / app.js View on Github external
export const ServerApp = props => {
  const { url, context, helmetContext, store } = props;
  setupLocale();
  HelmetProvider.canUseDOM = false;
  return (
    <IntlProvider locale={config.locale} messages={localeMessages}>
      <Provider store={store}>
        <HelmetProvider context={helmetContext}>
          <StaticRouter location={url} context={context}>
            <Routes routes={routeConfiguration()} />
          </StaticRouter>
        </HelmetProvider>
      </Provider>
    </IntlProvider>
  );
};

react-helmet-async

Thread-safe Helmet for React 16+ and friends

Apache-2.0
Latest version published 10 months ago

Package Health Score

79 / 100
Full package analysis