Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

react-use-pwa-install

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-pwa-install

Custom React hook for PWA install button.

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
1.3K
-23.41%
Maintainers
1
Weekly downloads
 
Created
Source

react-use-pwa-install npm npm type definitions

Custom React hook for PWA install button.

Installation

npm install react-use-pwa-install

How to use

import { usePWAInstall } from 'react-use-pwa-install'

export const Header = () => {
	const install = usePWAInstall()

	return (
		<header>
			<h1>My app</h1>
			{install && <button onClick={install}>Install</button>}
		</header>
	)
}

Screencast

UI example

Demo

Check website or code.

Note

Don't forget to fulfill PWA requirements (web.dev, mdn) otherwise the usePWAInstall will return null. Same goes for already installed app.

Keywords

react

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts