0
0
React Nativemobile~10 mins

Why Firebase powers mobile backends in React Native - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import Firebase in a React Native app.

React Native
import [1] from '@react-native-firebase/app';
Drag options to blanks, or click blank then click option'
AReact
BApp
CfirebaseApp
Dfirebase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'React' or 'App' instead of 'firebase' in import.
2fill in blank
medium

Complete the code to initialize Firebase in your React Native app.

React Native
const app = [1]();
Drag options to blanks, or click blank then click option'
AstartApp
BinitializeApp
CcreateApp
DrunApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'startApp' or 'runApp' which are not Firebase methods.
3fill in blank
hard

Fix the error in the code to get a Firestore database instance.

React Native
const db = firebase.[1]();
Drag options to blanks, or click blank then click option'
Afirestore
Bstorage
Cdatabase
Dauth
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'database()' instead of 'firestore()' for Firestore.
4fill in blank
hard

Fill both blanks to write data to Firestore in React Native.

React Native
db.collection('[1]').[2]({ name: 'John' });
Drag options to blanks, or click blank then click option'
Ausers
Badd
Cset
Ddocuments
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'set' without specifying a document, or wrong collection name.
5fill in blank
hard

Fill all three blanks to listen for authentication state changes.

React Native
firebase.auth().[1]((user) => {
  if (user) {
    console.log('[2] logged in');
  } else {
    console.log('[3] logged out');
  }
});
Drag options to blanks, or click blank then click option'
AonAuthStateChanged
BUser
DAuth
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method name or incorrect strings in console.log.