[DOCS-13758] LogInView.js in the react-native Realm tutorial lacks an export statement Created: 09/Jul/20  Updated: 29/Oct/23  Resolved: 27/Jul/20

Status: Closed
Project: Documentation
Component/s: Realm, Tutorial
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Critical - P2
Reporter: Chandler Wyatt Assignee: Mohammad Chughtai (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 3 years, 28 weeks, 2 days ago
Epic Link: DOCSP-10176
Story Points: 2

 Description   

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.)



 Comments   
Comment by Mohammad Chughtai (Inactive) [ 27/Jul/20 ]

https://github.com/mongodb-university/realm-tutorial/pull/50

https://github.com/mongodb/docs-realm/pull/368

Generated at Thu Feb 08 08:08:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.