2.2.2 • Published 3 years ago

@bettercode/react-app-version-checker v2.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@bettercode/react-app-version-checker

This module checks to update the code when the React App is redeployed.

Requirements

You need a REST API to query the app version. The Http response value should be as follows.

{
 "version": 2
}

Getting started

Install

# Using npm
npm install --save @bettercode/react-app-version-checker

# Using yarn
yarn add @bettercode/react-app-version-checker

Usage

import React from 'react'

import { AppVersionChecker } from '@bettercode/react-app-version-checker'

const App = () => {
  return <AppVersionChecker
                message={'Updated to new version. Click \'OK\' to use the latest version.'}
                minuteInterval={1}
                versionApiEndPoint="http://localhost:3000/version.json"/>
}

image

Component Properties

PropertyDescriptionDefault Value
messageThe text of the message area
minuteIntervalcheck cycle
versionApiEndPointversion checking REST API endpoint
onOkSet the handler to handle click eventwindow.location.reload()
okTextThe text of the Ok buttonOk
zIndexCSS z-index value1
bgColorBackground color#ffc75f
2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago