How to use the react-feather.hasOwnProperty function in react-feather

To help you get started, we’ve selected a few react-feather examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github contiamo / operational-ui / packages / components / lib / Icon / Icon.js View on Github external
var Icon = function (props) {
    var color = theme_1.expandColor(props.theme, props.color) || "currentColor";
    var defaultSize = props.theme.spacing * 1.5;
    if (ReactFeather.hasOwnProperty(props.name)) {
        var Comp = ReactFeather[props.name];
        return React.createElement(Comp, { size: props.size || defaultSize, color: color });
    }
    // @todo -> type this better
    if (BrandIcons.hasOwnProperty(props.name)) {
        var Comp = BrandIcons.OperationalUI;
        if (props.name === "Labs") {
            Comp = BrandIcons.Labs;
        }
        if (props.name === "Pantheon") {
            Comp = BrandIcons.Pantheon;
        }
        if (props.name === "Contiamo") {
            Comp = BrandIcons.Contiamo;
        }
        return React.createElement(Comp, { size: props.size || defaultSize, color: color, rotation: props.rotation, colored: props.colored });