Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.

fusionjs/fusion-plugin-react-helmet-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a1357df · Apr 12, 2019

History

80 Commits
Oct 25, 2018
Mar 26, 2018
Mar 26, 2018
Apr 12, 2019
Mar 26, 2018
Apr 2, 2018
Mar 26, 2018
Apr 18, 2018
Mar 26, 2018
Apr 19, 2018
Oct 25, 2018
Mar 26, 2018
Apr 20, 2018
Oct 25, 2018
Mar 21, 2019
Mar 26, 2018
Mar 21, 2019

Repository files navigation

fusion-plugin-react-helmet-async

Build status

Allows adding content into the document head via a component driven api.


Table of contents


Installation

yarn add fusion-plugin-react-helmet-async

Usage

This plugin is a simple wrapper on the react-helmet-async module which handles the context provider and server side code for you.

import {Helmet} from 'fusion-plugin-react-helmet-async';

const app = (
  <App>
    <Helmet>
      <title>Hello World</title>
      <link rel="canonical" href="https://www.tacobell.com/" />
    </Helmet>
    <h1>Hello World</h1>
  </App>
);

Setup

This module has no dependencies or configuration. Simply register the plugin.

// src/main.js
import App from 'fusion-react';
import HelmetPlugin from 'fusion-plugin-react-helmet-async';
import Root from './components/root';
export default async function main() {
  const app = new App(<Root />);
  app.register(HelmetPlugin);
  return app;
}