Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
React native Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined

On react native I have error

Error: Element 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, or you might have mixed up default and named imports.

Code:

    import React, { Component } from "react";
import { collection  } from "@cuba-platform/react-core";
import { ActivityIndicator, ScrollView, StyleSheet, Text } from "react-native";
import { PredefinedView } from "@cuba-platform/rest";
import { observer } from "mobx-react";
import { colors } from "../styles/palette";
import { StmObj, StmObjView } from "../cuba/entities/pros_StmObj";
import {DataTable, buttons} from "@cuba-platform/react-ui";
import {injectIntl, WrappedComponentProps} from 'react-intl';

const styles = StyleSheet.create({
  list: {
    marginTop: 16
  },
  item: {
    fontSize: 16,
    color: colors.textPrimary,
    marginTop: 4,
    marginBottom: 4
  },
  title: {
    fontSize: 18,
    fontWeight: "bold",
    marginTop: 16
  }
});


@observer
export class Example extends React.Component  {
  usersData = collection<StmObjView<"_base">>(StmObj.NAME, {
    view: PredefinedView.BASE,
    limit: 5
  });



  render() {
    const { status, items } = this.usersData;

    if (status !== "DONE") {
      return <ActivityIndicator color={colors.textPrimary} />;
    }

    return (
      <>
        <Text style={styles.title}>Список систем телеметрии:</Text>
        <ScrollView style={styles.list}>
          {items.map(item => (
            <Text style={styles.item} key={item.id}>
              {item._instanceName}
            </Text>
          ))}
          
 <DataTable dataCollection={collection}
           columnDefinitions={[
             'item',
             'manufacturer',
             {
               field: 'price',
               columnProps: {
                 align: 'right'
               }
             }
           ]}
           onSelectedRowChange={this.onSelectedRowChange}
           buttons={buttons}
           tableProps={{
             bordered: true
           }}
/>
          
        </ScrollView>
        

        
      </>
    );
  }
}

const Telemetry = injectIntl(Example);
export default Telemetry;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!