Socket
Socket
Sign inDemoInstall

@types/react-helmet

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-helmet

TypeScript definitions for react-helmet


Version published
Weekly downloads
958K
decreased by-4.61%
Maintainers
1
Weekly downloads
 
Created

What is @types/react-helmet?

@types/react-helmet provides TypeScript definitions for the react-helmet library, which is used to manage changes to the document head in a React application. This includes setting the title, meta tags, and other head elements dynamically.

What are @types/react-helmet's main functionalities?

Setting the Document Title

This feature allows you to set the document title dynamically within a React component.

import { Helmet } from 'react-helmet';

function MyComponent() {
  return (
    <div>
      <Helmet>
        <title>My Page Title</title>
      </Helmet>
      <h1>Welcome to My Page</h1>
    </div>
  );
}

Adding Meta Tags

This feature allows you to add meta tags to the document head dynamically within a React component.

import { Helmet } from 'react-helmet';

function MyComponent() {
  return (
    <div>
      <Helmet>
        <meta charSet="utf-8" />
        <meta name="description" content="My page description" />
      </Helmet>
      <h1>Welcome to My Page</h1>
    </div>
  );
}

Link Tags

This feature allows you to add link tags, such as canonical links, to the document head dynamically within a React component.

import { Helmet } from 'react-helmet';

function MyComponent() {
  return (
    <div>
      <Helmet>
        <link rel="canonical" href="https://www.example.com/my-page" />
      </Helmet>
      <h1>Welcome to My Page</h1>
    </div>
  );
}

Other packages similar to @types/react-helmet

FAQs

Package last updated on 05 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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