我想添加react-native-custom-tabs
我的项目,但问题是它正在显示
无法读取
openURL
未定义的属性。
import CustomTabs from 'react-native-custom-tabs';
class HomeScreen extends Component {
constructor(props) {
super(props);
this.state = {
images: []
};
this.onPressListener = this.onPressListener.bind(this);
}
async onPressListener(event) {
try {
const url = 'https://www.google.com';
CustomTabs.openURL(url);
} catch (error) {
Alert.alert(error.message)
}
}
}
我使用yarn add react-native-custom-tabs安装了它,然后将它与react-native链接起来了react-native-custom-tabs
尝试像导入import {CustomTabs} from 'react-native-custom-tabs';
而不是import CustomTabs from 'react-native-custom-tabs';
希望能帮助到你。毫无疑问
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句