1.1.3 • Published 3 years ago

react-headband v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-headband

A simple controller for your document titles

NPM JavaScript Style Guide

Install

npm install --save react-headband

Description

react-headband is a lightweight, zero-dependency package that allows you to easily set your document's titles for different routes.

Usage

In-order to use react-headband, simply import it into your project, then wrap each route declaration with Headband, while setting the desired title as a parameter.

You can add the optional scrollToTop parameter if you wish for that behavior when navigating to the route.

Example:

import React from "react";

import Headband from "react-headband";

import Page1 from "pages/page1";
import Page2 from "pages/page2";

function App() {
  return (
    <Headband title="Page no. 1">
      <Page1 />
    </Headband>
    <Headband title="Page no. 2" scrollToTop>
      <Page2 />
    </Headband>
  );
}

Notes

  • To avoid mismatch between titles and routes, make sure to use Headband on all routes.

License

MIT © tomleb3

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago