Skip to content

vasilevich/react-html-tag-attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

react-html-tag-attributes

Simple React component that lets you insert attributes into the tag from basically anywhere. as long as it is mounted.

once the component is unmounted, the previous attributes are back.

Usage

  • Install.
yarn add react-html-tag-attributes
  • Require component.
import HtmlTags from 'react-html-tag-attributes';
  • Setup and render.
import React, { Component } from "react";
import HtmlTags from 'react-html-tag-attributes';

class App extends Component {
  render() {
    return (
      <div className="App">
          <HtmlTags itemtype="https://schema.org/FAQPage"/>
      </div>
    );
  }
}

export default App;

or typescript:

import * as React from 'react';
import HtmlTags from 'react-html-tag-attributes';


export class App extends React.Component<any, any> {
  render() {
    return (
        <div>
            <HtmlTags itemtype="https://schema.org/FAQPage"/>
        </div>
    );
  }
}

About

Add attributes to the <html> tag on mount

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published