react-helmet npm code example

Example 1: react-helmet typescript

npm install --save @types/react-helmet

# Yarn
yarn add @types/react-helmet

Example 2: react helmet

import React from "react";
import {Helmet} from "react-helmet";

class Application extends React.Component {
  render () {
    return (
        <div className="application">
            <Helmet>
                <meta charSet="utf-8" />
                <title>My Title</title>
                <link rel="canonical" href="http://mysite.com/example" />
            </Helmet>
            ...
        </div>
    );
  }
};

Example 3: react helmet

// install helmet
npm i react-helmet

// yarn
yarn add react-helmet