Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13758

LogInView.js in the react-native Realm tutorial lacks an export statement

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: Realm, Tutorial
    • Labels:
      None

      Description

      The LogInView.js code in step 6* [ of the react-native Realm tutorial|https://docs.mongodb.com/realm/tutorial/react-native/#define-the-loginview] lacks an export statement, causing the app to throw:

      [Thu Jul 09 2020 17:02:02.210]  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.
      
      Check the render method of `AppBody`.
      
      This error is located at:
          in RCTView (at View.js:34)
          in View (at App.js:25)
          in RCTView (at View.js:34)
          in View (at SafeAreaView.js:41)
          in ForwardRef(SafeAreaView) (at App.js:24)
          in AppBody (at App.js:11)
          in AuthProvider (at App.js:10)
          in App (at renderApplication.js:45)
          in RCTView (at View.js:34)
          in View (at AppContainer.js:106)
          in RCTView (at View.js:34)
          in View (at AppContainer.js:132)
          in AppContainer (at renderApplication.js:39)
      

      Adding the following line of code to the end of the file allowed the app to run properly for me on an Android emulator:

      export default LogInView;
      

      Additionally, Step 8 says to create the file as schemas.json, but the code provided is JS, not JSON.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            mohammad.hunan@mongodb.com Mohammad Chughtai (Inactive)
            Reporter:
            chandler.wyatt@mongodb.com Chandler Wyatt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              3 years, 43 weeks, 1 day ago