npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-mlist-masonry

v1.0.0

Published

React Native Masonry List for Pinterest like UI implemented just like the [FlatList].

Downloads

5

Readme

react-native-mlist-masonry

npm version

此项目基于(react-native-masonry-list)[https://github.com/hyochan/react-native-masonry-list],版本1.1.1

开始

yarn add react-native-mlist-masonry
import MasonryList from 'react-native-mlist-masonry';

预览

| 2列 | 3列 | 4列 | |------------|:-----------:|:-----------:| ||||

Props

innerRef?: MutableRefObject<ScrollView | undefined>;
keyPrefix?: string;
loading?: boolean;
refreshing?: RefreshControlProps['refreshing'];
onRefresh?: RefreshControlProps['onRefresh'];
onEndReached?: () => void;
onEndReachedThreshold?: number;
style?: StyleProp<ScrollViewProps>;
data: T[];
renderItem: ({item: T, i: number}) => ReactElement;
LoadingView?: React.ComponentType<any> | React.ReactElement | null;
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null;
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null;
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null;
numColumns?: number;

innerRef - Expose ScrollView instance with ref, example usage: ref.current.scrollTo.

keyPrefix - Add prefix for keying child views. This is currently incremented by 1.

loading - Currently in loading status.

refreshing - Currently in refreshing status.

onRefresh - Callback when refresh has been triggered.

onEndReached - Callback when end is reached just like the onEndReached in FlatList

style - Style props for ScrollView which is the container view.

data - The array of the data for the view to render in renderItem

renderItem - Render custom view with the data passed down.

LoadingView - Custom loading view when the view is in loading status.

ListHeaderComponent - Header component

ListFooterComponent - Footer component

ListEmptyComponent - Component to render when the data is empty.

numColumns - Number of columns you want to render. Default to 2.

Usage

<MasonryList
  data={filteredItems}
  keyExtractor={(item, index): string => index.toString()}
  numColumns={2}
  renderItem={({item}) => <CardItem />}
  onRefresh={() => refetch({first: ITEM_CNT})}
  onEndReachedThreshold={0.1}
  onEndReached={() => loadNext(ITEM_CNT)}
/>