Having a hard time setting up next.js / expo

  Expo CLI 3.19.2 environment info:
    System:
      OS: macOS 10.15.4
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
    IDEs:
      Android Studio: 3.6 AI-192.7142.36.36.6392135
      Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
    npmPackages:
      expo: ~37.0.3 => 37.0.8 
      react: ~16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 

In App.tsx, I have:

import React from 'react';
import MyApp from './pages/_app'

export default MyApp

And in ./pages/_app.tsx, I have:

function MyApp({ Component, pageProps }: AppProps) {

    const dim = Dimensions.get('screen')

    return (
        <PaperProvider theme={theme}>
            <View style={{ flex: 1, height: 'auto', maxHeight: dim.height }}>
                <View style={{ flex: 10, marginBottom: 50 }}>
                     <Component {...pageProps} />
                </View>
            </View>
        </PaperProvider>
    )
}

export default MyApp

My /pages/index.tsx is:

function HomePage() {
  return <div>Welcome to Next.js!</div>
}

export default HomePage

But when I do expo start, I get the ambiguous error:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s%s, 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 your code at _app.tsx:21., 
    in MyApp (at withExpoRoot.js:21)
    in RootErrorBoundary (at withExpoRoot.js:20)
    in ExpoRoot (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in DevAppContainer (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- node_modules/react/cjs/react.development.js:172:36 in warningWithoutStack

Fun fact, if I replace <Component with just a <Text or something, then it works. Help me expo, you’re my only hope.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.