An open API service indexing awesome lists of open source software.

https://github.com/makotot/enabled-update-if

:six_pointed_star: Skip unnecessary rerendering with render props.
https://github.com/makotot/enabled-update-if

component performance react render-props shouldcomponentupdate

Last synced: 2 months ago
JSON representation

:six_pointed_star: Skip unnecessary rerendering with render props.

Awesome Lists containing this project

README

        

# EnabledUpdateIf

[![npm version](https://img.shields.io/npm/v/enabled-update-if.svg?style=flat-square)](https://www.npmjs.com/package/enabled-update-if)
[![License](http://img.shields.io/npm/l/enabled-update-if.svg?style=flat-square)](https://github.com/makotot/enabled-update-if)
[![CircleCI](https://circleci.com/gh/makotot/enabled-update-if.svg?style=svg)](https://circleci.com/gh/makotot/enabled-update-if)

> Skip unnecessary rerendering with render props.

## Why?

`shouldComponentUpdate` in each components is hard to maintain. `` makes more obvious and readable when the component is able to update or not.

## Install

```sh
$ npm i enabled-update-if
```

## Usage

```js
import React from 'react'
import EnabledUpdateIf from 'enabled-update-if'

return (


{
() => (
...
)
}



)
```

If you want to stop update `` when modal is opened, wrap with `` with passing the state of modal visibility to `condition` prop.

## License

MIT