1.0.0 • Published 5 years ago
react-set-title v1.0.0
react-set-title
Simple way to change web app title with react
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](https://github.com/pacifio)
1.0.0
5 years ago