Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/christopherabouabdo/react-native-photo-grid


https://github.com/christopherabouabdo/react-native-photo-grid

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# react-native-photo-grid
React Native component that handles the complexities of building a grid of photos with a flexible number of photos per row

## Install

`npm install react-native-photo-grid --save`

## Usage

```
import React from 'react-native';
import PhotoGrid from 'react-native-photo-grid';
let { Image, TouchableOpacity, Text } = React;

class BestGrid extends React.Component {

constructor() {
super();
this.state = { items: [] };
}

componentDidMount() {
// Build an array of 60 photos
let items = Array.apply(null, Array(60)).map((v, i) => {
return { id: i, src: 'http://placehold.it/200x200?text='+(i+1) }
});
this.setState({ items });
}

render() {
return(

);
}

renderHeader() {
return(
I'm on top!
);
}

renderItem(item, itemSize) {
return(
{
// Do Something
}}>


)
}

}

export default BestGrid;
```