введите описание изображения здесь
Я пытаюсь добавить свой CardsSection
компонент в мой Card
компонент, однако я получаю эту ошибку о нарушении текста, но я даже не использую какой-либо текст в моих Tournament
, Card
или CardSection
. JS файлы. Я не понимаю, почему я получаю эту ошибку. Может кто-нибудь сказать мне, что делать и почему?
Tournament.js
import React from "react";
import { View, Text, Image, ScrollView } from "react-native";
import { Card, Button, Spinner, CardSection } from "../common";
class Tournaments extends React.Component {
static navigationOptions = {
tabBarLabel: "Tournaments"
};
render() {
return (
<View style={styles.containerStyle}>
<Card>
<View style={styles.logoContainer}>
<Image
style={styles.logo}
source={require("../../Images/ShoeJackCityLogo.png")}
/>
</View>
<View style={styles.formContainer} />
</Card>
<ScrollView horizontal>
<Card>
<View style={{ flex: 1, flexDirection: "row" }}>
<CardSection>
<Image
style={styles.product}
source={require("../../Images/aj_4_toro.png")}
/>
</CardSection>
<CardSection>
<Image
style={styles.product}
source={require("../../Images/aj_4_toro.png")}
/>
</CardSection>
<CardSection>
<Image
style={styles.product}
source={require("../../Images/aj_4_toro.png")}
/>
</CardSection>
</View>
</Card>
</ScrollView>
</View>
);
}
}
const styles = {
containerStyle: {
flex: 1,
backgroundColor: "#F13C20",
paddingBottom: 20
},
logoContainer: {
alignItems: "center",
flexGrow: 1,
justifyContent: "flex-start",
paddingBottom: 15
},
logo: {
paddingTop: 15,
width: 50,
height: 50
},
product: {
width: 100,
height: 100,
paddingBottom: 15,
marginRight: 50
}
};
export default Tournaments;
CardSection.js
import React from 'react';
import { View } from 'react-native';
const CardSection = (props) => (
<View style={styles.containerStyle}>
{props.children};
</View>
);
const styles = {
containerStyle: {
borderBottomWidth: 1,
padding: 5,
backgroundColor: 'white',
justifyContent: 'flex-start',
flexDirection: 'row',
borderColor: '#ddd',
position: 'relative'
}
};
export { CardSection };
Card.js
import React from 'react';
import { View } from 'react-native';
const Card = (props) => (
<View style={styles.containerStyle}>
{props.children}
</View>
);
const styles = {
containerStyle: {
borderBottomWidth: 0,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 2,
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 30,
}
};
export { Card };