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

@stream-io/flat-list-mvcp

Package Overview
Dependencies
Maintainers
10
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stream-io/flat-list-mvcp

`maintainVisibleContentPosition` support for Android react-native

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
decreased by-16.6%
Maintainers
10
Weekly downloads
 
Created
Source

maintainVisibleContentPosition prop support for Android react-native.

In react-native, ScrollView (and FlatList) component have support for a prop maintainVisibleContentPosition, which is really useful for chat-like applications where you want to see new messages scroll into place. Although currently its only supported on iOS. So here we have built a simple wrapper for FlatList and ScrollView to add support for this prop for android. On iOS, we simply return FlatList and ScrollView from react-native package.

We built this wrapper for our in-house react-native chat sdk, but we are making it public, in case it helps other devs from react-native community.

Credits: Thanks to stackia for https://github.com/facebook/react-native/pull/29466#issuecomment-664367382

Installation

yarn add @stream-io/flat-list-mvcp

Usage

import { FlatList, ScrollView } from 'maintained-content-visible-position-flat-list';

<FlatList
    maintainVisibleContentPosition={{
        autoscrollToTopThreshold: 10,
        minIndexForVisible: 1,
    }}
    ...
/>

<ScrollView
    maintainVisibleContentPosition={{
        autoscrollToTopThreshold: 10,
        minIndexForVisible: 1,
    }}
    ...
/>

Contributing

PRs for improvement are welcome :)

License

MIT

Keywords

FAQs

Package last updated on 09 Dec 2020

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