我在试着从React Native Material乘AppBar
.我在IconButton
中使用的图标来自react-native-vector-icon.我不知道为什么我会被错误地说成Element type is invalid: expect a string. Check the render method for IconButton,因为我从React Native Material
官方文档中抄袭了准确的代码.
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}
/>
)}
/>