1.0.0 • Published 5 years ago

react-set-title v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

propsvalue typerequired
titlestringtrue

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](https://github.com/pacifio)
1.0.0

5 years ago