Nativebase: Icons not shown

Created on 25 Sep 2017  路  3Comments  路  Source: GeekyAnts/NativeBase

react-native, react and native-base version

react: 16.0.0-alpha.12
react-native: 0.47
native-base: 2.3.2

Expected behaviour

An icon should be shown when I use <Icon name="menu">

Actual behaviour

A substitute icon is shown.

Steps to reproduce (code snippet or screenshot)

screenshot_20170925-115027
The full source code is

export default class App extends React.Component {
    render() {
        return (
            <Container>
                <Header>
                    <Left>
                        <Button transparent>
                            <Icon name="home" />
                        </Button>
                    </Left>
                    <Body>
                        <Title>Termine</Title>
                    </Body>
                </Header>
                <Content>
                    <Text>Appointments...</Text>
                </Content>
            </Container>
        );
    }
}

Is the bug present in both ios and android or in any one of them?

At least on an Android device...

Most helpful comment

@aloifolia You need to link the icons. run react-native link or react-native link react-native-vector-icons

All 3 comments

@aloifolia I tried the above code with the versions specified. But the home icon was displaying properly. Can you check these issues #76 & #138

@aloifolia You need to link the icons. run react-native link or react-native link react-native-vector-icons

set type attribute depend on Bundled Icon Sets(list below)
Example <Icon name="flash-off" type="MaterialIcons" />

Bundled Icon Sets
Entypo
EvilIcons
Feather
FontAwesome
Foundation
Ionicons
MaterialIcons
MaterialCommunityIcons
Octicons
Zocial
SimpleLineIcons

Nativebase use: react-native-vector-icons
See full docs here: https://github.com/oblador/react-native-vector-icons

Was this page helpful?
0 / 5 - 0 ratings