import React, { Component, PropTypes } from 'react';
import { View, Text } from 'react-native';
export default class ListItem extends Component {
static propTypes = {
title: PropTypes.string,
}
static defaultProps = {
title: '標題',
}
constructor(props) {
super(props);
}
render() {
return (
<View>
<Text>
{this.props.title}
</Text>
</View>
);
}
}
import React, { Component } from 'react';
import ListItem from './ListItem';
export default class sample1 extends Component {
render() {
return (
<ListItem title="標題" />
);
}
}