react-simple-page-title
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

react-simple-page-title

Change the document.title declaratively inside your React app - without any dependencies.

Why?

I've wanted to simply change my page title dynamically in the SPA I was developing without any unnesesary features that could increase the bundle size.

This library doesn't support SSR - for alternatives see Alternatives

Install

npm

npm install react-simple-page-title

yarn

yarn add react-simple-page-title

Usage

Component

import { PageTitle } from 'react-simple-page-title';

const MyComponent = () => {
  return (
    <PageTitle title="Use this string as title of the page">
  )
}

Hook

import { usePageTitle } from 'react-simple-page-title';

const MyComponent = () => {
  usePageTitle("Use this string as title of the page");

  return (
    // ...
  )
}

Alternatives

This library doesn't support SSR. For more advanced alternative that supports SSR check out react-helmet or react-head.

If you're using a framework use a solution that was made for your framework:

Package Sidebar

Install

npm i react-simple-page-title

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

6.36 kB

Total Files

8

Last publish

Collaborators

  • witoszekdev-bot
  • taniotanio7