-
Type: Task
-
Resolution: Fixed
-
Priority: Critical - P2
-
None
-
Affects Version/s: None
-
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.