1.0.0 • Published 6 years ago

prop-types-elementtype v1.0.0

Weekly downloads
2,228
License
MIT
Repository
github
Last release
6 years ago

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
};