Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug (?)] - BackAndroid is deprecated and has been removed from this package. Use BackHandler instead #993

Closed
flixyudh opened this issue Apr 24, 2019 · 2 comments

Comments

@flixyudh
Copy link

flixyudh commented Apr 24, 2019

I'm just used simple render like below but throwing BackAndroid is deprecated and has been removed from this package. Use BackHandler instead

import React, { Component } from 'react';
import { Text, TouchableOpacity, View, TouchableHighlight } from 'react-native';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';

export default class Profile extends Component {
  render() {
    return (
      <View style={{flex:1}}>
        <TouchableHighlight
          style={{position:'absolute', padding:10, top:15, left:15, borderRadius:50, justifyContent:'center', alignItems:'center'}}
          onPress={()=>{}}
          underlayColor={"#737373"}
        >
          <MaterialCommunityIcons name={"menu"} size={30}/>
        </TouchableHighlight>
      </View>
    )
  }
}

I've tried to use find all in react-native-vector-icons folder using vscode editor, but somehow i didn't find it, anyone has an idea how to fix it?

Environment:
"react": "16.8.3",
"react-native": "0.59.5",
"react-native-vector-icons": "^6.4.2",
"react-navigation": "^3.9.0"

@jesster2k10
Copy link

I got this same error as soon as I enabled @babel/plugin-transform-modules-commonjs' plugin. Removing it makes the library work but at expense of hot reloading when using the import/export pattern. See this issue for more facebook/react-native#22592

@aniruddhbhamare
Copy link

this works for me.
update metro.config.js

"react": "^16.6.0",
"react-native": "0.59.5",
"react-native-vector-icons": "^6.6.0",

before:
module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false, }, }), }, };

after:
module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: true, inlineRequires: true } }) } };

@johnf johnf closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants