I'm trying to use an AppBar
from React Native Material. The icon i use in the IconButton
is from react-native-vector-icon. I have no idea why I'm getting error saying Element type is invalid: expect a string. Check the render method for IconButton as I literally copied the exact code from the React Native Material
official doc.
import {AppBar, IconButton} from '@react-native-material/core';
import {Icon} from 'react-native-vector-icons/Entypo';
<AppBar
title="Title"
leading={props => (
<IconButton
icon={props => <Icon name="menu" {...props} />}
{...props}
/>
)}
/>
CodePudding user response:
==> Try My Code it works.
import {AppBar, IconButton} from '@react-native-material/core';
import Icon from 'react-native-vector-icons/Entypo';
<AppBar
title="Title"
leading={props => (
<IconButton
icon={props => <Icon name="menu" {...props} />}
{...props}
/>
)}
/>