Skip to content

'FlatList' - React.createElement: type is invalid -- expected a string (for built-in components) or a class/function #15948

@anvesh523

Description

@anvesh523

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in

While I'm using FlatList in my code, I'm getting this error. If I remove the FlatList code, the app is working fine. I imported FlastList in my code too and I'm export the container.

import { ListView, Text, FlatList } from 'react-native';

render() {
return (

  <FlatList
    data={[{ key: 'a' }, { key: 'b' }]}
    renderItem={({ item }) => <Text>{item.key}</Text>}
  />

);

}

export default connect(mapStateToProps, mapDispatchToProps)(HistoryViewport);

Please give some solution, where I'm doing mistake! What I forgot to export the component from the file?

2017-09-14_17-31-12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions