1.0.0 • Published 3 years ago

@ziphooks/use-title v1.0.0

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

@ziphooks/use-title

React Hook for changing a title from HTML.

Installation

yarn

yarn add @ziphooks/use-title

npm

npm i @ziphooks/use-title

Usage

import React from "react";
import useTitle from "@ziphooks/use-title";

function App() {
  const changeTitle = useTitle("Home");
  setTimeout(() => {
      changeTitle("Hi");
  }, 3000);
  return <h1>The title is going to change to 'Home' and change to 'Hi' in 3 seconds</h1>;
};

Arguments

ArgumentTypeDescriptionRequired
initialTitleStringA string for initial a title from HTMLtrue

Return

Return valueTypeDescription
setTitleFunctionA function to change a title from HTML