This package has been deprecated

Author message:

dont use this

react-viewport-mixin

0.0.3 • Public • Published

react-viewport-mixin

A react mixin that improves performance by only rendering visible components.

For the purposes of this component, "visible" means that:

  1. The page itself is visible to the user (not in a hidden browser tab)
  2. It is at least partly positioned within the current viewport.

React components that use this mixin will not update if the element is not visible. It will, however, update when it becomes visible again, meaning that the user will never know the difference.

Install

npm install react-viewport-mixin

To see it in action, open the demo (build/example/index.html) in your browser.

Usage

 
var reactViewportMixin = require('react-viewport-mixin');
 
MyComponent = React.createClass({
  mixins: [reactViewportMixin],
  render: function() {
    // ...
  }
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i react-viewport-mixin

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • spudly