Skip to content

includable/react-update-popup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-update-popup

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

NPM GitHub license

Install

Works out of the box for create-react-app apps.

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 />
)

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
  • string assetManifestUrl - this is how we check if the React app has been updated, defaults to /asset-manifest.json
  • function onReload - replace default reload behaviour

Authors

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published