storybookjs / addon-react-native-web

Build react-native-web projects in Storybook for React
MIT License
83 stars 24 forks source link

react native vector icons do not show [Bug] #51

Closed grinono closed 1 year ago

grinono commented 1 year ago

I'm trying to see /react-native-vector-icons in storybook

I run storybook react native web with webpack5 config.

 core: {
    builder: 'webpack5',
  },

Steps to reproduce the behavior

i added the following code to the .storybook/main.js file

      name: '@storybook/addon-react-native-web',
      options: {
        modulesToTranspile: ['react-native-vector-icons'],
      },
    },

When loading a story with an icon from

import Entypo from "react-native-vector-icons/Entypo";

   <Entypo name={name} size={18} style={{ color: iconColor }} />

i get a square box

Screenshot 2023-02-01 at 11 23 35

Does anyone know how to fix this?

dannyhw commented 1 year ago

@grinono you need to add the fonts otherwise it won't have anything to show, see the vector icons readme I also have a working example here the example is a bit old but the same thing should still work.

grinono commented 1 year ago

yes, i saw the configs like that, but we are using webpack5 requires other config to enable vector icons. We switch the expo icons. that works fine :-)

dannyhw commented 1 year ago

Ok then since you don't have the problem anymore I will close this issue 👍