react-lifecycles-log

0.1.3 • Public • Published

react-lifecycles-log

NPM version Build Status Coverage Status NPM downloads Dependencies Status code style: prettier

Quickly debug the life cycle of the react component.

"peerDependencies": { "react": "^16.3.1" }

Install

npm install react-lifecycles-log -D

Usage

import React from 'react';
import LifeHOC from 'react-lifecycles-log';
 
@LifeHOC
export defalut class C extends React.Component {
    ...
}
 
// or
 
LifeHOC(C)

Test

check it out

  T -> constructor {} {}
 
  T -> getDerivedStateFromProps {} {}
 
  T -> render[1]
 
  child.constructor
 
  child.getDerivedStateFromProps {} {}
 
  child.render
 
  child.componentDidMount
 
  T -> componentDidMount
 
  T -> getDerivedStateFromProps { newProps: 'newProps' } {}
 
  T -> shouldComponentUpdate { newProps: 'newProps' } {} {}
 
  T -> render[2]
 
  child.getDerivedStateFromProps { newProps: 'newProps' } {}
 
  child.shouldComponentUpdate { newProps: 'newProps' } {} {}
 
  child.render
 
  child.componentDidUpdate {} {} undefined
 
  T -> componentDidUpdate {} {} undefined
 
  T -> componentWillUnmount
 
  child.componentWillUnmount
 
  -------------- closed ------------------
 
  child.constructor
 
  child.getDerivedStateFromProps {} {}
 
  child.render
 
  child.componentDidMount

License

MIT

/react-lifecycles-log/

    Package Sidebar

    Install

    npm i react-lifecycles-log

    Weekly Downloads

    7

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    9.46 kB

    Total Files

    4

    Last publish

    Collaborators

    • bzone