prop-types-elementtype

PropTypes for elementType until merged in official

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
prop-types-elementtype
011.0.04 years ago4 years agoMinified + gzip package size for prop-types-elementtype in KB

Readme

PropTypes.elementType
PropTypes for React element types.
You can use this library until this PR is merged in the official PropTypes.
npm install prop-types-elementtype
or
yarn add prop-types-elementtype
Usage
import React from 'react';
import elementType from 'prop-types-elementtype';

const MyComponent = () => <div>Hello there!</div>;

const MyWrapper = ({ welcomer: Welcomer }) => <Welcomer />;
MyWrapper.propTypes = {
  welcomer: elementType
};