How to use the kind2string.getKind function in kind2string

To help you get started, we’ve selected a few kind2string 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 Noviny / pretty-proptypes / src / PropType / index.js View on Github external
console.error(
      `Prop ${
        propType.key
      } has no type; this usually indicates invalid propType or defaultProps config`
    );
    return null;
  }

  const name = propType.kind === 'spread' ? '...' : convert(propType.key);
  const OverrideComponent = overrides[name];
  const commonProps = {
    components,
    name,
    key: name,
    required: !propType.optional,
    type: getKind(propType.value),
    defaultValue: propType.default && convert(propType.default),
    description: description,
    shouldCollapse: shouldCollapseProps,
    typeValue: propType.value
  };

  return overrides[name] ? (
    
  ) : (
    
  );
};
github atlassian / extract-react-types / packages / pretty-proptypes / src / PropType / index.js View on Github external
console.error(
      `Prop ${
        propType.key
      } has no type; this usually indicates invalid propType or defaultProps config`
    );
    return null;
  }

  const name = propType.kind === 'spread' ? '...' : convert(propType.key);
  const OverrideComponent = overrides[name];
  const commonProps = {
    components,
    name,
    key: name,
    required: !propType.optional,
    type: getKind(propType.value),
    defaultValue: propType.default && convert(propType.default),
    description,
    shouldCollapse: shouldCollapseProps,
    typeValue: propType.value
  };

  return overrides[name] ?  : ;
};
github JedWatson / react-select / PrettyPropTypes / src / Props.js View on Github external
console.error(
      `Prop ${
        propType.key
      } has no type; this usually indicates invalid propType or defaultProps config`,
    );
    return null;
  }

  const name = convert(propType.key);
  const OverrideComponent = overrides[name];
  const commonProps = {
    components,
    name,
    key: convert(propType.key),
    required: !propType.optional,
    type: getKind(propType.value),
    defaultValue: propType.default && convert(propType.default),
    description: description,
    shouldCollapse: shouldCollapseProps,
    typeValue: propType.value,
  };

  return (
    overrides[name] ?  : 
  );
};

kind2string

Utility to ensure extract-react-types output can be rendered without errors

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages