Socket
Socket
Sign inDemoInstall

react-static-container

Package Overview
Dependencies
6
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-static-container

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


Version published
Weekly downloads
9.7K
increased by1.24%
Maintainers
2
Install size
111 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 20 Oct 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc