New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

render-doctor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

render-doctor

A React higher-order component for diagnosing unnecessary renders.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Render Doctor

renderDoctor is a React higher-order component for diagnosing unnecessary renders and identifying faulty selectors. It adds a logger function to a component that lists all changed props and state. Additionally, it checks if changed props are deeply equal, to identify unnecessary renders.

Usage

Decorate the component you are investigating with renderDoctor:

import renderDoctor from 'render-doctor';

@renderDoctor
export default class ComponentToCheck extends Component {
	...component code
};

renderDoctor will then automatically send diagnoses about the decorated component's props and state to the console.

Usage Example

Additionally, renderDoctor logs an object to the console containing the old and new props and state, as well as a property deepEqual, which is either true or an object containing the differences between the old and new objects.

When the component is in use, the internal function compareObjects used to compare props and state is also exported to window to ease debugging.

Installation

Using npm:

$ npm i -g npm
$ npm i --save-dev render-doctor

Keywords

react

FAQs

Package last updated on 13 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts