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)” ```jsx 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