i have this error last days and still couldnt find the solution.error code ise here.
Element type is invalid: expected a string (for built in components) or class/function (for composite components) but got: undenifed.You likely forgot to export your component from the file its defined in, or you might have mixed up default or named imports.
Check the render of method of 'cellRenderer'
i updated React for last version. but still error is continue.NPM versiyon ise 6.13.1. i think error is very small but i cant see it.thanks for your helps.
here is my codes;
dataItem.js
import React, {Component} from 'react';
import {Body, Button, Left, ListItem, Right, Text, Thumbnail} from 'native-base';
class DataItem extends Component {
constructor(props) {
super(props);
this.data = props.data;
}
render() {
return (
<ListItem thumbnail>
<Left>
<Thumbnail
square
source={{
uri:
this.data.urlToImage != null
? this.data.urlToImage
: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWBAMAAADOL2zRAAAAG1BMVEXMzMyWlpajo6PFxcW3t7ecnJyqqqq+vr6xsbGXmO98AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABPUlEQVRoge3Tv0/CQBjG8YcWaMcebymOENLI2MZoHMHEvVUKjq1K4lhM2Kvxx7/tUUiamDhc6GSez8INzbf3HleAiIiIiIiIiIiIiNozAGzvuJYTW2reXmso7bX8YN96HUR1a7RZ6+VVOgU+p4LuZGrSkqK0PWfwfl+3ht/hcpdvPkJ0g0fBYpYZtS7HttfPMatbAbZzJ1kjjnqVK1ihNzdpdX3b65S4qVsjXbG9EtuoEzliC/RbDFoIL7wY2NZrQayPzw1VpH/FUUqNjVrx0+9W8Rzrlt7yMMvMWq7fzHhoCTp6Rr0vw0uiH8+as69bov/AyNqf/Rms3Ky1aO7EYV93X2nlBIXg7WVSmrWs5q4eWrvVdYLbpR4/PTeZ8S9O82mdzMr7SVstV6mqrRaKh9ZSRERERERERET0n/wAZwMqI9kyPcoAAAAASUVORK5CYII=',
}}
/>
</Left>
<Body>
<Text numberOfLines={2}>{this.data.title}</Text>
<Text note numberOfLines={2}>
{this.data.description}
</Text>
</Body>
<Right>
<Button transparent>
<Text>OKU</Text>
</Button>
</Right>
</ListItem>
);
}
}
export default DataItem ;
tab1.js
import React, {Component} from 'react';
import {Alert, View, ActivityIndicator} from 'react-native';
import { Container, Content, List, Text } from 'native-base';
import {DataItem} from '../../component/dataItem';
import {getArticles} from '../../service/news';
export default class ListThumbnailExample extends Component {
constructor(props) {
super(props);
this.state= {
isLoading: true,
data: null
}
}
componentDidMount() {
getArticles().then(data => {
this.setState({
isLoading: false,
data: data
});
}
)
}
render() {
console.log(this.state.data);
let view = this.state.isLoading ? (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<ActivityIndicator animating={this.state.isLoading} color="#00f0ff" />
<Text style={{marginTop: 10}} children="Please Wait.." />
</View>
) : (
<List
dataArray={this.state.data}
renderRow={(item) => {
return (
<DataItem onPress={this.handleItemDataOnPress} data={item} />
)
}} />
)
return (
<Container>
<Content>
<List
dataArray={this.state.data}
renderRow={(item) => {
return <DataItem data={item}/>
}}
/>
</Content>
</Container>
);
}
}