Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-defer-renderer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-defer-renderer

This library helps implement lazy rendering for react-native.

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by500%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-defer-renderer

This library helps implement lazy rendering for react-native.

install

npm install react-native-defer-renderer --save

usage

Let's take news article page for example - a long <Article /> component with <Comment /> component at the bottom. It's efficient only to render <Comment /> component if the user scroll close to the <Comment /> component

Before:

<ScrollView>
  <Article />
  <Comment />
</ScrollView>

After:

<ScrollProvider>
	<Article />
	<ScrollReceiver name="ScrollReceiver" threshold={100}>
		<Comment />
	</ScrollReceiver>
</ScrollProvider>

The library provides two components:

<ScrollProvider />

  • will return a react-native <ScrollView /> with all the props
  • main purpose is to provide scroll position to the child <ScrollReceiver /> component

<ScrollReceiver />

  • warp the component to be lazy rendered
  • will receive scroll position from ` as props
  • when props update, it will decide to render the wrapped component if close enough.

demo

please check the example folder

Keywords

FAQs

Package last updated on 03 Jun 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc