...
/Solution Review: Android Components and APIs
Solution Review: Android Components and APIs
Get a detailed review of the solution to the challenge.
We'll cover the following...
The Android widget below contains the solution to the challenge. We will also go through a step-by-step explanation of the solution.
Note: Click the “Run” button on the Android widget below to execute the program. Wait for the program to compile inside the “Terminal” tab of the widget, and then switch to the “Output” tab once the program has been successfully compiled.
Solution
/** * @format */ import 'react-native'; import React from 'react'; import App from '../App'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; it('renders correctly', () => { renderer.create(<App />); });
Coding playground
In the solution code provided above:
-
Lines 22–34: We create a function named
backActionEvent
. This function will be called once the user presses the hardware back button of the Android device or ...