Chito Adinugraha
Chito Adinugraha

Reputation: 1320

React Native Button Icon not showing

I am using expo's snack, no icon ever showing correctly, what am I doing wrong? I test this snack https://callstack.github.io/react-native-paper/button.html, and many other snack, but it always show rectangle icon.

Buttons always show rectangle icon I am using expo 36.0.0

Upvotes: 1

Views: 2508

Answers (1)

WarRisk
WarRisk

Reputation: 34

The issue is visible in expo log as

Tried to use the icon 'stepforward' in a component from 'react-native-paper', but 'react-native-vector-icons' could not be loaded. To remove this warning, try installing 'react-native-vector-icons' or use another method to specify icon: https://callstack.github.io/react-native-paper/icons.html. Even if you try to add package it's still not resolved by this, some issue in expo as reported here Expo forums

Following is the workaround as Snack link

  1. Using Expo vector Icon
import { Ionicons } from '@expo/vector-icons';

2.Get type

import SimpleIcon from 'react-native-vector-icons/SimpleLineIcons';

import MaterialIcons from 'react-native-vector-icons/MaterialIcons';

then pass as child

Upvotes: 1

Related Questions