1.0.2 • Published 5 years ago
@am-hooks/use-title v1.0.2
useTitle
브라우저 탭 제목을 변경
Installation
yarn
yarn add @am-hooks/use-title
npm
npm i @am-hooks/use-title
Usage 1
import React from "react";
import useTitle from "@am-hooks/use-title";
const App = () => {
useTitle("change title");
return <h1>HELLO</h1>;
}
Usage 2
import React from "react";
import useTitle from "@am-hooks/use-title";
const App = () => {
const titleUpdater = useTitle("Loading...");
setTimeout(() => titleUpdater("Home"), 3000);
return <h1>HELLO</h1>;
}
Arguments
Argument | Type | Description | Required |
---|---|---|---|
title | string | The title you want to use on your document | yes |