kschingiz:meteor-react-update-notifier

v1.1.0Published 5 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor React Update Notifier

This package allows you to notify your users about meteor app update.

If the app is updated you can give your user a choice whether he/she wants to update the page or continue working

Installation

meteor add kschingiz:meteor-react-update-notifier

Usage

1import React from "react";
2import MeteorUpdateNotifier from "meteor/kschingiz:meteor-react-update-notifier";
3
4class App extends React.Component {
5  constructor(props) {
6    super(props);
7
8    this.onUpdate = this.onUpdate.bind(this);
9  }
10
11  onUpdate() {
12    window.location.reload();
13  }
14
15  render() {
16    return (
17      <MeteorUpdateNotifier>
18        <div>
19          <h4>New Version is available, do you want to reload?</h4>
20          <input type="button" value="Update" onClick={this.onUpdate} />
21          <input type="button" value="Not yet" onClick={this.hide}/>
22        </div>
23      </MeteorUpdateNotifier>
24    );
25  }
26}

Props

Update notifier component can accept following props:

  1. disabled - true/false, enable or disable the component

TODO

  1. Tests