close exit app react native

JavaScript
import React, { BackHandler } from 'react-native';
BackHandler.exitApp();
Source

Also in JavaScript: