Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

reactjs/react-static-container

Repository files navigation

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

npm install react-static-container

Usage

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

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

class MyComponent extends React.Component {
  render() {
    return (
      <div>
        {this.props.value}
        <StaticContainer>
          <MyOtherComponent value={someValue} />
        </StaticContainer>
      <div>
    );
  }
 );

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published