react-set-title

1.0.0 • Public • Published

react-set-title

Simple way to change web app title with react

NPM JavaScript Style Guide

Install

npm install --save react-set-title

Usage

Method 1

import React, { Component } from 'react'
import Title from 'react-set-title'
 
class Home extends Component {
  render () {
    return (
      <Title title="Home | react app" >
        {/*Your react code here*/}
      </Title>
    )
  }
}

Props

props value type required
title string true

Method 2

With a function "changeTitle(title:string)"

import React, { Component } from 'react'
import { changeTitle } from 'react-set-title'
 
class Home extends Component {
  componentDidMount() {
    changeTitle('Home | react app');
  }
 
  render () {
    return (
      <div>
        {/*Your react code here*/}
      </div>
    )
  }
}
function name parameter type required
changeTitle string false

License

MIT © pacifio

Readme

Keywords

none

Package Sidebar

Install

npm i react-set-title

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

10.5 kB

Total Files

6

Last publish

Collaborators

  • pacifio