Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/reactjs/react-static-container

Renders static content efficiently by allowing React to short-circuit the reconciliation process.
https://github.com/reactjs/react-static-container

Last synced: 3 months ago
JSON representation

Renders static content efficiently by allowing React to short-circuit the reconciliation process.

Awesome Lists containing this project

README

        

# react-static-container

Renders static content efficiently by allowing React to short-circuit the
reconciliation process. This component should be used when you know that a
subtree of components will never need to be updated.

Typically, you will not need to use this component and should opt for normal
React reconciliation.

## Installation

```sh
npm install react-static-container
```

## Usage

```js

var StaticContainer = require('react-static-container');

var someValue = ...; // We know for certain this value will never change.

class MyComponent extends React.Component {
render() {
return (


{this.props.value}




);
}
);
```

`StaticContainer` also takes a `shouldUpdate` prop as an escape hatch, allowing granular updates.