stowball / react-native-svg-icon

A simple, but flexible SVG icon component for React Native

Home Page:https://medium.com/@stowball/creating-an-svg-icon-system-in-react-native-fa0964ea5fe4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

style prop applied to SvgIcon generating warning

danieldai opened this issue · comments

I want to adjust the position of icon with style

<Icons style={styles.place} name="Place" width="12" height="12"/>
const styles = StyleSheet.create({
  place: {
    marginTop: 4,
    marginLeft: 2,
  },
})

the position is changed, but it generates some annoying warning:

Warning: Failed prop type: Invalid prop `style` supplied to `SvgIcon`.

the work around is use in this way

<Icons style={[styles.place]} name="Place" width="12" height="12"/>

or

<Icons style={{marginTop: 4, marginLeft: 2,}} name="Place" width="12" height="12"/>

Sorry, I apparently missed this for 6 months :-. Will fix!

I just published 0.8.1 which fixes this issue