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.
- Host: GitHub
- URL: https://github.com/makotot/enabled-update-if
- Owner: makotot
- Created: 2018-10-13T15:47:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T16:47:27.000Z (over 6 years ago)
- Last Synced: 2025-03-30T16:02:29.267Z (2 months ago)
- Topics: component, performance, react, render-props, shouldcomponentupdate
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EnabledUpdateIf
[](https://www.npmjs.com/package/enabled-update-if)
[](https://github.com/makotot/enabled-update-if)
[](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