Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rehooks/document-title

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rehooks/document-title - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

index.d.ts
interface DocumentTitle {}
export default function useDocumentTitle(title: string): DocumentTitle;
export default function useDocumentTitle(title: string, retainOnUnmount?: boolean): DocumentTitle;
'use strict';
let { useEffect } = require('react');
let { useRef, useEffect } = require('react');
function useDocumentTitle(title) {
function useDocumentTitle(title, retainOnUnmount = false) {
const defaultTitle = useRef(document.title);
useEffect(() => {
document.title = title;
}, [title])
}, [title]);
useEffect(() => {
return () => {
if (!retainOnUnmount) {
document.title = defaultTitle.current;
}
};
}, []);
}
module.exports = useDocumentTitle;
{
"name": "@rehooks/document-title",
"version": "1.0.1",
"version": "1.0.2",
"description": "React hook for updating document-title",

@@ -21,15 +21,12 @@ "main": "index.js",

"scripts": {
"test": "ava test.js",
"test": "echo 'done!'",
"example": "parcel example.html"
},
"dependencies": {
"react": "^16.8.3"
"react": "^16.13.1"
},
"devDependencies": {
"ava": "^1.2.1",
"browser-env": "^3.2.6",
"parcel": "^1.11.0",
"raf": "^3.4.0",
"react-dom": "^16.8.3",
"react-test-renderer": "^16.8.3"
"parcel": "^1.12.4",
"react-dom": "^16.13.1",
"react-test-renderer": "^16.13.1"
},

@@ -36,0 +33,0 @@ "ava": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc