2.0.0 • Published 4 years ago

react-doc-title v2.0.0

Weekly downloads
39
License
MIT
Repository
github
Last release
4 years ago

react-doc-title

NPM JavaScript Style Guide Build Status

Install

yarn add react-doc-title

Usage

import React from 'react'
import {Provider, Title, useTitle} from 'react-doc-title'

function MyComponent() {
  useTitle('Contact')
  return <p>Contact us</p>
}

function App() {
  return (
    <Provider title="My website">
      <Title string="About" />
      <MyComponent />
    </Provider>
  )
}

Document title would be Contact - About - My website

Provider

<Provider> needs to wrap any <Title>. You can change settings here too

prop nametypedefaultmisc
titlestring
appendbooleanfalseIf this is set to true the example would be My website - About - Contact
dividerstring-Change the divider between title fragments

Title

Adds a title fragment

prop nametype
stringstring

License

MIT © benjick

2.0.0

4 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago