Skip to content

Latest commit

 

History

History
executable file
·
37 lines (33 loc) · 1.59 KB

DynamicCard.md

File metadata and controls

executable file
·
37 lines (33 loc) · 1.59 KB

Dynamic Card

A center aspect designed for efficient representation of vertically scrolling lists of changing data. This can be achieved on the same lines as that of dataArray concept of List.
Create a Card dataArray, populate it with an easy array of data chunks, and instantiate a CardItem component with that chunk of data and a renderRow callback which takes a chunk from the whole data array and returns a renderable component.

Preview ios Dynamic_Card Preview android Dynamic_Card

Syntax

import React, { Component } from 'react';
import { Container, Content, Card, CardItem, Text, Thumbnail } from 'native-base';
let themes = [
    {
        name: 'Native Starter Pro',
        image: require('./img/NSP.png')
    },
    . . .];
export default class DynamicCardExample extends Component {
    render() {
        return (
            <Container>
                <Content>
                    <Card dataArray={themes}
                          renderRow={(theme) =>
                            <CardItem>
                                <Thumbnail source={theme.image} />
                                <Text>{theme.name}</Text>
                            </CardItem>
                        }>
                    </Card>
                </Content>
            </Container>
        );
    }
}