UNPKG

move-prop-types

Version:

"Help quickly replace the prop type checker in older react projects to map to prop-types"

13 lines (10 loc) 276 B
import React from 'react'; import PropTypes from 'prop-types'; const Button = ({ label, onClick }) => ( <button onClick={onClick}>{label}</button> ); Button.propTypes = { label: PropTypes.string.isRequired, onClick: PropTypes.func.isRequired }; export default Button;