2

When I try to run yarn ios, I get:

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.

Check the render method of `MyApp`.

But my App.tsx, has:


class MyApp extends App {


  render() {
    const { Component, pageProps } = this.props;
    return (
      <ThemeProvider theme={theme}>
        <ScrollView>
          <Component {...pageProps} />
        </ScrollView>
        <FooterBar />
      </ThemeProvider>
    )
  }
}

export default MyApp

So I'm not sure what it's complaining about?

Dez
  • 5,702
  • 8
  • 42
  • 51
Shamoon
  • 41,293
  • 91
  • 306
  • 570

2 Answers2

1

Try importing the component directly from its origin and plugging in your pageProp after. So in example :

import {Component} from '../pathOfComponent';
Uluc Ozdenvar
  • 59
  • 1
  • 7
1

You most likely are not passing anything in this.props.Component. Javascript is quite tricky, if the element does not exist it will treat it as undefined

Prashanth M
  • 326
  • 1
  • 7