old-state

Decorator for ReactJS components that saves the old state before it gets updated.


Keywords
decorator, old, state, react, ui, decorators, reactjs
License
Apache-2.0
Install
npm install old-state@1.0.6

Documentation

Decorator for ReactJS components that saves the old state before it gets updated.

Installation

npm install --save old-state

Usage

import React, { Component } from 'react'
import oldState from 'old-state'

@oldState
class SomeComponent extends Component {
  render() {
    let previousState = this.oldState
    let currentState = this.state
    // ...
  }
}