defaultProps allows you to set the defaultProps
of the wrapped React component.
const SubmitButton = Html.Button
.defaultProps({ type: 'submit' })
propTypes sets the propTypes
of the React component.
import PropTypes from 'prop-types'
const Title = Html.H1
.style(({ highlighted }) => ({
backgroundColor: highlighted ? 'yellow' : 'transparent'
}))
.propTypes({
children: PropTypes.node,
highlighted: PropTypes.bool
})
Both rely on recompose
higher-order components under the hood.