New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-update-popup

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-update-popup

Ask users to refresh when there is a new version of the app available.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
177
increased by30.15%
Maintainers
0
Weekly downloads
 
Created
Source

react-update-popup

Ask users to refresh when there is a new version of the app available.

NPM GitHub license

Install

yarn add react-update-popup
# or: npm install --save react-update-popup

Usage

import React, { Component } from 'react'

import { UpdateNotification } from 'react-update-popup'
import 'react-update-popup/dist/index.css'

const Example = () => (
  <UpdateNotification
    checkHasUpdate={async () => {
      // Optionally do something custom to check if an update is available.
      // Called every 120 seconds.

      // If you omit this, the default behaviour is to check if `index.html`
      // has changed, which is the case with most bundlers.

      return true // tell it an update is available
    }}
  />
)

Styling

By default, the popup looks like this:

Example

Update it to fit within your application by:

  • Using the component props to change the text of the popup
  • Adding custom CSS for class .update-notification-popup to restyle the popup

Props

All props are optional, and can be used to change the appearance of the popup.

  • string title - popup title, wrapped in <h3>
  • string description - popup description text, wrapped in <p>
  • string buttonText - button text
  • number refreshInterval - how often to check, defaults to 120_000 (2 minutes)
  • function checkHasUpdate - replace default update check behaviour (returns boolean hasUpdate)
  • function onReload - replace default reload behaviour

Authors

This library is developed by Includable, a creative app development agency.

FAQs

Package last updated on 14 Jan 2025

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

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