Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

React Native - Invariant Violation on ToolbarAndroid

$
0
0

I tried using ToolbarAndroid component but I always get this error message

enter image description here

import { View, StyleSheet, Image, TouchableOpacity, ToolbarAndroid } from 'react-native';

public render() {
return (
  <View>
    <ToolbarAndroid 
      style={styles.toolbar}
      title="test"
    />
    <TouchableOpacity onPress={this.props.navigation.openDrawer}>
        <Icon name={'md-menu'} size={30} />
    </TouchableOpacity>
  </View>
);


const styles = StyleSheet.create({
toolbar: {
    backgroundColor: '#2196F3',
    height: 56,
}});

but It works fine if I remove the ToolbarAndroid component. I tried copy pasting other codes but got same error. I'm using "react-native": "0.61.5" version.


Viewing all articles
Browse latest Browse all 6208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>