Socket
Socket
Sign inDemoInstall

react-pwa-install-prompt

Package Overview
Dependencies
6
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.2

4

package.json
{
"name": "react-pwa-install-prompt",
"version": "1.0.0",
"version": "1.0.2",
"description": "A react hook to prompt the install of your PWA in supported browers (Chrome desktop & mobile)",

@@ -39,3 +39,2 @@ "author": "eric-edouard",

"@typescript-eslint/parser": "^2.26.0",
"microbundle-crl": "^0.13.10",
"babel-eslint": "^10.0.3",

@@ -54,2 +53,3 @@ "cross-env": "^7.0.2",

"gh-pages": "^2.2.0",
"microbundle-crl": "^0.13.10",
"npm-run-all": "^4.1.5",

@@ -56,0 +56,0 @@ "prettier": "^2.0.4",

@@ -24,6 +24,15 @@ # react-pwa-install-prompt

const renderInstallButton = () => {
const onClickInstall = async () => {
const didInstall = await promptInstall()
if (didInstall) {
// User accepted PWA install
}
}
const renderInstallButton = () => {
if (isInstallPromptSupported && isStandalone)
return (
<button onClick={promptInstall}>Prompt PWA Install</button>
<button onClick={onClickInstall}>Prompt PWA Install</button>
)

@@ -33,3 +42,3 @@ return null

return (<div style={{marginLeft: '2em'}}>
return (<div>
<h2>PWA Infos</h2>

@@ -36,0 +45,0 @@ <p>Is Install Prompt Supported ? {isInstallPromptSupported ? 'true' : 'false'}</p>

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc