Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons for Tabs not showing on React Native 0.54.4 #2981

Closed
facuacostag opened this issue Apr 3, 2018 · 3 comments
Closed

Icons for Tabs not showing on React Native 0.54.4 #2981

facuacostag opened this issue Apr 3, 2018 · 3 comments

Comments

@facuacostag
Copy link

facuacostag commented Apr 3, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.27
  • react-native v0.54.4

Expected behaviour

I was using React Native 0.52.3 and custom tab icons were working as expected, as you can see in the image but once i updated React Native to the latest version they stopped working with no changes applied to the code or anything

screen shot 2018-04-03 at 12 18 54

<Scene
     key="activity"
     tabBarLabel="Activity"
     gesturesEnabled={false}
     hideNavBar
     component={ActivityScreen}
     icon={({ focused }) => (
     <Icon
        name={focused ? 'activity-active' : 'activity'}
        size={30}
        color={focused ? '#FFC920' : '#353535'}
      />
      )}
/>

Actual behaviour

The Icons are missing from the tab but the onPress behaviour works. It's not a problem with the icons library because they are shown in the whole app apart from the tab bar.

screen shot 2018-04-03 at 12 19 43

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  1. Update to RN 0.54.4
  2. Use custom Icon on the bar with react-native-vector-icons library
  3. Check that the icons are not showing

Update

I managed to fix the issue, It seems like for some reason you need to add the width to the style of the Icon and it will be shown again.

screen shot 2018-04-03 at 12 36 32

icon={({ focused }) => (
    <Icon
       style={{ width: 30 }}
       name={focused ? 'profile-active' : 'profile'}
       size={30}
       color={focused ? '#FFC920' : '#353535'}
    />
)}
@MaxInMoon
Copy link
Contributor

@FacuAcosta thanks for the fix which also fixes with [email protected]

@eddiesigner
Copy link

In my case I had to set the height as well ([email protected])

@dwilt
Copy link

dwilt commented May 7, 2018

It makes <Text> invisible too. You need to wrap a <View> around the <Text> and give it a width and height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants