bamlab/react-native-formik

BackAndroid error when using React Native 0.58

Closed this issue · 2 comments

After upgrading to React Native 0.58, I experienced this error on Android:

BackAndroid is deprecated and has been removed from this package. Use BackHandler instead.

I tracked the issue down to @bam.tech/react-native-modalbox:

'use strict';

var React = require('react');
var PropTypes = require('prop-types');
var {
  View,
  StyleSheet,
  PanResponder,
  Animated,
  TouchableWithoutFeedback,
  Dimensions,
  Easing,
  BackAndroid,
  BackHandler,
  Platform,
  Modal,
  Keyboard
} = require('react-native');

var createReactClass = require('create-react-class');

var BackButton = BackHandler || BackAndroid;
...

Removing BackAndroid from this file seems to solve the problem.

Version 1.7.0 of react-native-modalbox makes this fix.

You may want to publish a new version of @bam.tech/react-native-modalbox that removes the deprecated BackAndroid.

@taranda Thanks for reporting! The fix has been merged!

@taranda Thanks for the insights. Upgradingreact-native-modalbox solved the issue.