项目作者: marcin-mazurek

项目描述 :
:wrench: Render debugger for React
高级语言: JavaScript
项目地址: git://github.com/marcin-mazurek/react-render-debugger.git
创建时间: 2015-09-12T15:49:47Z
项目社区:https://github.com/marcin-mazurek/react-render-debugger

开源协议:MIT License

下载


React Render Debugger

A visual way to see what is (re)rendering and why.

Decorator/higher-order function version ported from https://github.com/redsunsoft/react-render-visualizer

Learn more about the experimental decorator syntax.

Features

  • Shows when component is being mounted or updated by highlighting (red for mount, yellow for update)
  • Shows render count for each component instance
  • Shows individual render log for each component instance

Installation

  1. npm install react-render-debugger

Usage

Import and apply to any React component you want to start monitoring:

  1. import React, { Component } from 'react';
  2. import debugRender from 'react-render-debugger';
  3. // Use with the decorator syntax (experimental)
  4. @debugRender
  5. class DecoratedComponent extends Component {
  6. render () {
  7. // ...
  8. }
  9. }
  10. // Or simply passing the component to the function
  11. class PlainComponent extends Component {
  12. render () {
  13. // ...
  14. }
  15. }
  16. const WrappedPlainComponent = debugRender(PlainCompoent);

Component will show up with a blue border box when being monitored.

Demo

See a demo page: http://react-render-visualizer-decorator.netlify.com

Similar libraries