Skip to content

Passing SVG icon as value #155

@smallsaucepan

Description

@smallsaucepan

Wondering what the expectations around passing an SVG icon as the value are? I can see from #71 and #101 that raster images are supported. However, it doesn't seem to allow for SVG - passing as a React element complains the value isn't a string, and passing using require('some.svg') gives a UIImage size related error.

Could we try to extend the values prop to accept a function that returns an icon? Along the lines of react-navigation tab navigator which lets you do this:

({color, size}) => ( <SettingsIcon fill={color} width={size} height={size} /> ) 

where SettingsIcon is a react-native-svg <Svg> element.

Pros or cons? Other thoughts? @andresain123 @Naturalclar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions